user2451341
user2451341

Reputation: 55

Unbalanced parenthesis or bracket

I assign the command as follow:

[r,~]=size(alternative)

The problem I get: Unbalanced or unexpected parenthesis or bracket.

Anyone knows why? I have alternative size of 252x6

Thanks

Upvotes: 4

Views: 837

Answers (1)

user2469775
user2469775

Reputation: 447

You are running an old Matlab version (older than R2009b).
The use of ~ as unassigned to argument is relatively new feature to Matlab.

Use instead:

[r, ignore] = size( alternative );

See How to elegantly ignore some return values of a MATLAB function? on other methods to accomplish what you are trying.

PS,
Specifically for size you can specify the dimension you are interested in as an input argument:

r = size( alternative, 1 ); % get only the number of rows

Upvotes: 5

Related Questions