return value did not change
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
hye, here is my code, other variable is working except for r(i+1),it return the same value for i=0 until 100 ,can someone tell me how to solve this?
function [Resistant ] = resistance(w,l,h)
G = 1.59*10.^-8;
u =pi*4*10.^-7;
p= 6.30 *10.^7;
f = 0:100;
for i= 0:100;
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)
Resistant(i+1) = p*l/r(i+1);
end
end
3 件のコメント
Stephen23
2018 年 4 月 4 日
@rose wright: please give us the exact values of w, l, and h that you used.
rose wright
2018 年 4 月 4 日
Adam
2018 年 4 月 4 日
If you are so certain r(i+1) is the same for every i I assume you are using the debugger so surely it is easy to see what the problem is if you are? Just look at its components on the command line each time round the loop.
If it isn't changing it suggests that q * v is constant for each iteration.
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!