u = 5;
E = 1000;
w = [0:1:100000];
z=1+((w*u)/E).^2
A = w*u/sqrt((z))
figure
plot(w, A); % Plot
% As always, label your graphs
xlabel('Frequency [rad/s]');
ylabel('Amp[Pa]');
title('Amplitude vs Frequency');
My Command Window shows no errors. So I don't understand what is wrong.

 Réponse acceptée

KSSV
KSSV le 9 Nov 2016
Modifié(e) : KSSV le 9 Nov 2016

1 vote

Element by element division in A. In your case it was only a scalar.
u = 5;
E = 1000;
w = [0:1:100000];
z=1+((w*u)/E).^2 ;
A = w*u./sqrt((z)) ; element by element division
figure
plot(w, A); % Plot
% As always, label your graphs
xlabel('Frequency [rad/s]');
ylabel('Amp[Pa]');
title('Amplitude vs Frequency');

Plus de réponses (1)

Catégories

En savoir plus sur Line Plots dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by