MATLAB: How to do the following with MATLAB Editor

MATLAB

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:
  1. How to enable indenting in command window as well just like how we can enable it for the editor.
  2. 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?
  3. 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.

Best Answer

  1. Unknown in the Matlab world. Who would want that ;-)
  2. Good question. See What Is the MATLAB Search Path?. Use Packages Create Namespaces even if it requires more planning and typing. It requires a lot of manual work to organize a code base with packages afterwards. I have all my matlab code in subfolders under a folder named, "m", far away from the Matlab installation. And see the blog-post Best Practices – Adapt, then Adopt!
  3. Unknown in the Matlab world. We do that by typing and ask our-self what editor The MathWorks use in-house. The wish-list regarding the editor is long. I use Notepad++ when I "must" have regular expressions and more ... .
  4. Now "video tutorials on their website" are up and running.
"In other words if I want to work on a project "A"."
  1. Create the folder: MATLAB-Projects/A
  2. Add A to the MATLAB Search Path, which can be done in at least four different ways. There is a Set Path GUI under the HOME-ribbon, a command addpath, right click context menu, and more. That is good for the current session. To add it permanently you have to Save Path.
Live Edit might be the first manifestation of Matlabs new editor. See Introduction to the Live Editor