how do i store Xmax for this code?
Mostra commenti meno recenti
% I want to make a w vs Xmax graph. The script file is attached below.
for w=1:1:100
t=0:0.001:10
X=-100*w^-2*(sin(t*w))
Xmax=max(abs(X))
end
Risposte (1)
Walter Roberson
il 28 Mar 2018
Xmax(w) = max(abs(X));
2 Commenti
ian flanagan
il 28 Mar 2018
Walter Roberson
il 28 Mar 2018
Not when I try.
wvals = 1:1:100;
num_w = length(wvals);
Xmax = zeros(1,num_w);
t=0:0.001:10;
for widx = 1:num_w
w = wvals(widx);
X=-100*w^-2*(sin(t*w));
Xmax(widx)=max(abs(X));
end
plot(wvals, Xmax)
Categorie
Scopri di più su Graphics Objects in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!