How can I do the following with MATLAB Editor
Show older comments
I purchased matlab license 2 days ago and coming from a Python background, language similarities seems to be a smooth transition. However, there are a few things that I find missing at this point in the editor, perhaps someone could advise me on the following points:
- How to enable indenting in command window as well just like how we can enable it for the editor.
- How does 'path' work? It seems to be defaulted at Documents/MATLAB/. How do you organize and manage your project files from this point on?
- How do you configure your matlab code in such a way that for example, I want to reformat my code with whitespace around any operator or a whitespace before any keyword. For example the two lines of code below have an imbalanced whitespace distribution. This irks me. I want a neat code. Is there a way to do this w/o depending on external (3rd party) scripts or functions
%impropper whitespace balance befor/after operator
fidRead= fopen(fileName,'r');
fidWrite =fopen(bufferFile,'w');
%space before keyword
tline = fgetl(fidRead);
%no space before keyword
tline =fgetl(fidRead);
At this point I believe MathWorks is undergoing some technical issue with their servers, one cannot play any video tutorials on their website.
2 Comments
Adam
on 14 Nov 2017
The path works just like the windows path. You add whatever locations you want to it and that is where Matlab will look for functions.
Personally I have a MatlabDev folder that is linked to our Mercury/Hg repository and a load of subfolders under this which are mostly added to the path. I don't use the default location in Documents at all. I do, however, leave all other automatically added folders on my path as these are what give access to all the Matlab toolbox and builtin functions.
I add whitespace around operators myself, though like with any editor you can do find and replace stuff on a whole file.
Abhilash Sukumari
on 15 Nov 2017
Accepted Answer
More Answers (0)
Categories
Find more on Environment and Settings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!