How to solve error for Index exceeds matrix dimensions
Show older comments
for k = 1:1:(length(n_taylor_range))
S = n_taylor_range(k);
ys_taylor(1:(length(t))) = 0;
xs_taylor(S,1:(length(t))) = 0.;
for w = 1:1:S
xs_taylor(w,:) = -((K(w)*pw*cos((2*pi*k(w)*t)/pw))/(2*k(w)*pi));
ys_taylor = xs_taylor(w,:)+ys_taylor;
end
yss_taylor(k,:) = ys_taylor;
P_taylor(k,:) = (fc*t)+(((bw*(t.^2))/(2*pw))+ (bw*yss_taylor(k,:)));
end
2 Comments
KSSV
on 6 Dec 2017
YOu have not given all the variable and did't specify the error line. And note that this error comes when you try to extract more number of elements then existing in the data.
Muhamad Ridwan
on 6 Dec 2017
Edited: Muhamad Ridwan
on 6 Dec 2017
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!