MATLAB display a blank graph
Afficher commentaires plus anciens
hi, im trying to plot graph resistance against frequency. I managed to calculate the value of R, but i just get a blank graph when i tries to plot the result.Here is my codes
function [resistant ] = resistance(w,l,h)
G = 1.59*10.^-8;
u =pi*4*10.^-7;
p= 6.30 *10.^7;
f = 0:8;
for i= 0:8;
q(i+1)=(2/(2*pi*f(i+1)*u*G)).^(1/2);
v(i+1) = 1-exp(-h/q(i+1));
r(i+1)= w*q(i+1)*v(i+1);
R = p*l/r(i+1);
end
plot(f,R);
xlim([0 8]);
xlabel('frequency');
ylabel('resistance');
title('graph');
end
I hope somebody can tell me if there are any error in my codes.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!