Re: how to determine a length of a vector




Tessa wrote:
I have a structure and would like to determine the size of it and
compare it to the size of another structure. For example,
Y = [Y; object.Y]
X = [X; object.X]

How do I determine the size?

Size in what sense?

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

If you are actually looking for the memory size in
bytes, you can use the functional version of WHOS,
as in

whos('Y')

(Note the argument is the string 'Y').

- Randy

.