I have a working MATLAB code that works fine on another machine, but when I run it on my own computer, it detects the following syntax error:
Expression or statement is incorrect--possibly unbalanced (, {, or [.
This is my code:
[~,x] = min(A);
What version of MATLAB are you using?
The syntax ~for rejecting unwanted return values was introduced only in R2009b.
~
EDIT: Was 2008a.
You have an older version of MATLAB installed that does not recognize the syntax "~". Change ~ to "garbage" or some other variable name to remind yourself that you do not need the result, and the code should work fine.
MATLAB .