I’ve written a function which contains as a variable an array A whose entries are polynomials (e.g. A{1} = DocPolynom([1 2 3])).
I want to be able to find the length of the vector double(A{i}) for each entry of A. I wrote
length(double(A{i}));
But here Matlab thinks ‘length’ is a variable, for some reason. Why is this? How can I get round it?
Thanks
It seems quite likely that you somehow are using length as a variable. Matlab doesn’t prevent many value names from being used.
An alternative would be to use the size() function. The size will actually return the size of each dimension. Depending on how the array is used, you could probably use this: