"the function return value 'self inductance' might be unset"

11 次查看(过去 30 天)
hye, this is my codes,
function [ Selfinductance ] = Inductance(D_out,D_in,p)
u= pi*4*10.^-7;
y= 4*pi*p.^2;
X= (u*D_out.^3)/y;
a = D_in/ D_out;
B = (1 - a);
b = (1 + a);
m = X* (1-a.^2)*(1-a);
n = log(b/B) + (0.2235*(B/b))+ 0.726;
L = m*n
end
this codes is working perfectly but i got warning "the function return value 'self inductance' might be unset" and when i tried to call this function in another function,
function [ qfactor] = qfactor(D_out,D_in,p)
f= 0:8;
for i = 0:8
L= Inductance(D_out,D_in,p);
Q(i+1)= f(i+1)*L
end
end
I got this,
L =
4.5579e-06
Error in Inductance (line 3)
u= pi*4*10.^-7;
Output argument "Selfinductance" (and maybe others) not assigned during call to "C:\Users\.......
why this happened and how can i fix this?

采纳的回答

Star Strider
Star Strider 2018-3-19
Perhaps you intend:
Selfinductance = m*n;
or to return ‘L’ as the output.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Communications Toolbox 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by