member555
member555

Reputation: 807

Strange syntax error

I'm new to MATLAB, and I have the following problem:

I have the line:

[~, j] = min(matrix);

I don't understand what the ~ sign is for(I have to learn this code..) and the error is:

Expression or statement is incorrect--possibly unbalanced (, {, or [.

What can be the reason?


Another question, suppose I have got a file.m and inside of it I have the declaration:

methods (Static)
        function var = func(n, d)

How do I call this function with the 2 parameters from the command windows?

Upvotes: 0

Views: 43

Answers (1)

Cheery
Cheery

Reputation: 16214

i dont understand whats for ~ sign

Discard first returning output, it is not going to be used.

What can be the reason?

What version of Matlab do you use? This syntax has only been part of MATLAB since about R2009b or so.

How do i call this function func with the 2 parameters from the command windows?

Yes, otherwise - http://www.mathworks.com/help/matlab/matlab_prog/support-variable-number-of-inputs.html

Upvotes: 3

Related Questions