Is it possible to install matlab to check available functions before running

Background

I'm used to strongly typed, compiled languages, so I'm used to the fact that spelling errors are pretty much instantly perceived as undeclared variables.

However, since Matlab is a weakly typed language, this does not happen automatically, and my development cycle tends to be:

write function(s)
|
˅
Run  <-------------------------
|                             |
˅                             |
Crash due to misspelling/typo |
|                             |
˅                             |
Correct typo -----------------|

The startup process may work for several minutes before moving on to a typo, which will significantly slow down my development cycle.
I am using matlab version 2007b

Question

, .., ? , , , .

, , depfun, - .

, , , .

function [biggest]=getBiggest(variableName1, variableName2)
    if variablename1>variableName2, %<---misspelling!
        biggest=variableName1;
    else
        biggest=variableName2;
    end
end
+3
4

, , .

home > preferences > code analyzer, , , - :

, ...

+3

MATLAB Linter , (, ), . ( R2011b, ) , MATLAB: http://www.mathworks.com/help/matlab/ref/mlint.html

+1
0

Personally, I would create some unit tests. I am using xUnit , but there is a whole question for this: Testing unit for MATLAB .

Of course, he will catch syntax errors. In addition, it helps to check the algorithm.

0
source

All Articles