Re: how to determine a length of a vector



Randy Poe wrote:



size(Y) will give you the array dimensions. length(Y)
will give you the first dimension.

That description of length always catches me out as I extend my code
from one to two dimensions. length(x) actually returns the same as
max(size(x)), so there will be a point where it flips from one
dimension to another as the arrays grow.
.



Relevant Pages

  • Re: vectorise a reshape loop
    ... I think the communication issue stems from the fact i didn't ... understand the number of array dimensions could be above 3. ... non-singleton rhs dimensions than non-singleton subscripts'. ...
    (comp.soft-sys.matlab)
  • Simple Matrix Multiplication
    ... I have a rotation matrix 'rot_mat' 3x3x374 that I would like to ... Inner matrix dimensions must agree. ... Array dimensions must match for binary array op. ...
    (comp.soft-sys.matlab)
  • Re: vectorise a reshape loop
    ... understand the number of array dimensions could be above 3. ... non-singleton rhs dimensions than non-singleton subscripts'. ... the third index to be? ... Your assignment indices ...
    (comp.soft-sys.matlab)
  • Re: Matrix product
    ... Array dimensions must match for binary array op. ... the matching trailing 5 of the A and the leading 5 of B, ... two dimensional matrices. ...
    (comp.soft-sys.matlab)
  • Re: how to determine a length of a vector
    ... Steve Amphlett wrote: ... sizewill give you the array dimensions. ... will give you the first dimension. ...
    (comp.soft-sys.matlab)