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

11 visualizaciones (últimos 30 días)
rose wright
rose wright el 19 de Mzo. de 2018
Comentada: Star Strider el 20 de Mzo. de 2018
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?

Respuesta aceptada

Star Strider
Star Strider el 19 de Mzo. de 2018
Perhaps you intend:
Selfinductance = m*n;
or to return ‘L’ as the output.
  2 comentarios
rose wright
rose wright el 20 de Mzo. de 2018
it working now! thanks for helping
Star Strider
Star Strider el 20 de Mzo. de 2018
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Communications Toolbox en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by