Why is my plot plotting blank?

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.

 Accepted Answer

KSSV
KSSV on 9 Nov 2016
Edited: KSSV on 9 Nov 2016
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');

Tags

Asked:

MT
on 9 Nov 2016

Edited:

on 9 Nov 2016

Community Treasure Hunt

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

Start Hunting!