In python you can issue something like
if <condition>:
pass
This can come in handy as a placeholder for future code placement. What's the equivalent of "pass" in matlab when it comes to these kind of uses?
There is not equivalent for that, but since you have to declare the "end" of a function or a condition in MATLAB, you can leave it empty.
For example:
if (condition)
end
or just leave a comment:
if (condition)
% future code here
end
According to this:
http://www.mathworks.com/matlabcentral/answers/117519-do-nothing-command-in-matlab
You can just use a semicolon. You could also immediately go to end
as Christian suggested.
The pass
command is necessary in Python, because 1) indentation determines the scope for if/for/while
or for functions, and 2) there is no way of indicating that a block has ended except to un-indent. The combination of these two makes a no-op command pretty much necessary for the parser to work correctly. In Matlab, you have end
, so you don't have the same issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With