Error while using size(A,1)?

3 views (last 30 days)
Alessandro
Alessandro on 17 Dec 2013
Edited: Alessandro on 17 Dec 2013
Hello, I am trying to evaluate the number of rows of a certain matrix 'Conn' using
d = size(Conn,1)
If I initialise the matrix from an empty workspace like this
Conn = [1 2 3; 4 5 6]
the command displays the correct answer
d = 2
When using the exact same command inside a bigger script, I get this error message:
Subscript indices must either be real positive integers or logicals.
Anybody has a clue?
Thanks.

Accepted Answer

Sean de Wolski
Sean de Wolski on 17 Dec 2013
You have a variable names size.
Rename this variable and clear it.
  1 Comment
Alessandro
Alessandro on 17 Dec 2013
Looks like the most obvious answer usually is the correct one. Thank you so much, I was gonna get crazy on this!

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!