error in line1and 4
1 回表示 (過去 30 日間)
古いコメントを表示
Calculate the response function using the equation of motion:
omega_n = sqrt(k / m); % natural frequency
zeta = c / (2 * sqrt(m * k)); % damping ratio
omega_n = omega_n * sqrt(1 - zeta^2); % damped natural frequency
Calculate the response function using the equation of motion:
omega_n = sqrt(k / m); % natural frequency
zeta = c / (2 * sqrt(m * k)); % damping ratio
omega_d = omega_n * sqrt(1 - zeta^2); % damped natural frequency
figure;
plot(t, X);
xlabel('Time (s)');
ylabel('Displacement (m)');
title('Response of Mass-Spring-Damper System');
grid on;
0 件のコメント
回答 (1 件)
Chunru
2023 年 5 月 11 日
Those are comments which shoud start with %
% Calculate the response function using the equation of motion:
omega_n = sqrt(k / m); % natural frequency
zeta = c / (2 * sqrt(m * k)); % damping ratio
omega_n = omega_n * sqrt(1 - zeta^2); % damped natural frequency
% Calculate the response function using the equation of motion:
omega_n = sqrt(k / m); % natural frequency
zeta = c / (2 * sqrt(m * k)); % damping ratio
omega_d = omega_n * sqrt(1 - zeta^2); % damped natural frequency
figure;
plot(t, X);
xlabel('Time (s)');
ylabel('Displacement (m)');
title('Response of Mass-Spring-Damper System');
grid on;
2 件のコメント
Torsten
2023 年 5 月 11 日
It means that you defined a variable, but you didn't use this variable in the sequel. Thus deleting the line where you defined the variable would not change anything in the results from the code - usually an indicator that you made a mistake.
参考
カテゴリ
Help Center および File Exchange で Signal Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!