MATLAB: Size(array) fails

size(array)

filteredreducedSection
sz = size(filteredreducedSection)
line one prints 106 columns and 90 rows
Line two gives an error:
Subscript indices must either be real positive integers or logicals.
sz = size(filteredreducedSection)
What gives? Thanks.

Best Answer

Run this line in your Command Window:
which size -all
If the first result is:
size is a variable.
You’ve found the problem. (This is called ‘overshadowing’ of a funciton.) The solution is to rename your ‘size’ variable.