How to increase size of array
이전 댓글 표시
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)
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!