This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
it_matlab_startup [2024/03/23 23:21] trinh |
it_matlab_startup [2024/03/23 23:40] (current) trinh |
||
|---|---|---|---|
| Line 6: | Line 6: | ||
| <code matlab> | <code matlab> | ||
| - | edit(fullfile(userpath,' | + | edit(fullfile(userpath,' |
| - | </ | + | |
| + | |||
| + | Once you have run the above, the relevant startup file should appear. You can copy and paste the below as a starter. Comment in or out the relevant scripts. | ||
| <code matlab 1> | <code matlab 1> | ||
| Line 14: | Line 15: | ||
| % This adds all paths recursively from the directory | % This adds all paths recursively from the directory | ||
| - | addpath(genpath(' | + | % You can add the relevant directory where you store commonly used functions |
| + | % On windows, you may need to use a directory structure like C: | ||
| + | % addpath(genpath(' | ||
| % This adds a single path | % This adds a single path | ||
| - | addpath ~/ | + | % addpath ~/ |
| % Set figure default to something more pragmatic | % Set figure default to something more pragmatic | ||
| Line 40: | Line 44: | ||
| % Add the starting path | % Add the starting path | ||
| - | cd ~/ | + | % cd ~/ |
| </ | </ | ||
| + | |||
| + | You can try running the script. | ||
| + | |||
| + | If you exit Matlab and restart it, Matlab should run the startup script automatically. | ||
| + | |||
| + | The use of a startup file was common enough for me to make a guide on YouTube: | ||
| + | |||
| + | < | ||
| + | <iframe width=" | ||
| + | </ | ||