MATLAB display a blank graph

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.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by