Point out the error
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Syed Muhammad Umar
am 6 Okt. 2015
Kommentiert: Walter Roberson
am 6 Okt. 2015
Matlab script to animate the motion of vibrating guitar
A= 2;
L= 10;
f= 50;
ta= 2;
x=0:0.1:L;
T=5 ;
t=0;
for t < T
y=(A)*(exp^(-t/ta))*(sin((2*pi*x)/L))*(cos(2*pi*f*t));
plot(x,y)
t=t+0.1;
pause(0.5)
end
1 Kommentar
Akzeptierte Antwort
Walter Roberson
am 6 Okt. 2015
"for" must be followed by a variable name and then by an "=" and then an expression. The "for" loop will then be repeated assigning the values of the expression to the variable in turn.
You probably want "while" instead of "for"
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Acoustics, Noise and Vibration finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!