Open MATLAB path document in linux terminal

33 visualizzazioni (ultimi 30 giorni)
Tongyao
Tongyao il 31 Ago 2023
Risposto: Yash il 1 Set 2023
Basically I want something similar to matlab's `open some_script.m` command but in a terminal without launching matlab (not even matlab -nonsplash because it still takes time)
Why I want to do this? I use vscode to type my scripts, and sometimes I need to check the content of some functions in my matlab path. I am curious if there is some quick way to do this.
Please let me know if you need more clarification. Thanks!

Risposte (1)

Yash
Yash il 1 Set 2023
If you want to quickly view the content of MATLAB script files (.m) in your terminal without launching MATLAB, you can navigate to your MATLAB path by using the cd command and to view the scripts you can use various command-line text editors or viewers in linux. Here are a few options:
  1. cat Command: You can use the cat command to display the content of MATLAB script files in your terminal.
cat some_script.m
This will display the content of some_script.m directly in the terminal.
  • less Command: The less command allows you to view the content of a file one screen at a time. To view a MATLAB script
less some_script.m
You can scroll through the file using the arrow keys and exit by pressing q.
  • more Command: Similar to less, the more command lets you view files page by page
more some_script.m
This will display the content of some_script.m in the terminal.
  • vim Command: The most basic text editor available on linux platform.
vim some_script.m
Using these commands, you can quickly check the content of MATLAB script files without launching MATLAB or using any GUI-based editors. This should work well with VS Code, as you can open your terminal directly within VS Code and use these commands there.
I hope this helps.

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Prodotti


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by