Im extracting time-dependent data from a .dat file, and using the spline function, matching the values to an existing time-vector in use. For some reason the length function is failing to read the length of the vector.
I can recreate the error with this blurb:
x = linspace(1,98,76)';
y = 20.*x-5.*x.^2;
t = linspace(0,100,1000)';
yy = spline(x,y,t);
length(yy)
It returns
??? Subscript indices must either be real positive integers or logicals.
It shows in my workspace that yy is 1000x1 double, and max(size(yy)) works fine. Any idea on what creates this error?
You probably have a variable named length in your workspace. Use the whos command to see if this is the case.
whos length
This will print out the size and type of the variable length if it exists.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With