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

11 views (last 30 days)
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?

Accepted Answer

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

More Answers (0)

Categories

Find more on Communications Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!