How to increase size of array
Show older comments
Hey guys, I have this code (below) that leads to a plot. My question is how can I increase the size of Zh so my w linspace can have more data points? Right now, it can only do 33 because Zh is a 1x33. Is there any way I can change that? I'm not too advanced in Matlab, so I'm not sure how to increase it.
w_limit = 5*2*pi;
wn = sqrt(k./m);
F_harm = 1;
w = 0;
Zh = 0;
for w = 0:w_limit
r = w./wn;
Ft = k*Y*(r.^2)*(sqrt((1 + ((2*z*r).^2))/(((1-(r.^2)).^2)+((2*z*r).^2))));
F_harm = [F_harm;Ft];
Z = m*(w.^2)*0.0254/sqrt(((k-(m*(w.^2))).^2)+(c*w).^2);
Zh = [Zh Z];
w = w + 0.001;
end
w = linspace(0,5*2*pi,33);
figure(4)
plot(w,Zh)
Accepted Answer
More Answers (0)
Categories
Find more on Logical 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!