Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

"Not enough input arguments"

2 visualizaciones (últimos 30 días)
Gökcen
Gökcen el 26 de Jun. de 2014
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
function [xa1,xb1,xa2,xb2] = azeo(a,b)
if 0.35<a;
n=a*0.65/0.35;
k=n-b;
xb1=k/(k+1);
xa1=1-xb1;
else
m=b*0.35/0.65;
l=m-a;
xb2=l/(l+1);
xa2=1-xb2;
end
end
%i know it is a very simple code but i don't know what else to define, please help me and thank you in advance :)

Respuestas (2)

Sagar Damle
Sagar Damle el 26 de Jun. de 2014
Please format your question by selecting PROGRAM part in your question and then using button "{}Code".
Since xa1,xb1,xa2,xb2 are your output arguments,you should assign some value to EACH of them.In your code,you are assigning some value to xa1 and xb1 only in "if" part and to xa2 and xb2 only in the "else" part.Search for this PDF on internet -
User-Defined Functions in Matlab by K.Ming Leung

Andrei Bobrov
Andrei Bobrov el 26 de Jun. de 2014
function [x1,x2] = azeo(a,b)
t = .35 < a;
ab = b;
ab(t) = a(t);
m = (0.65/0.35).^(2*t-1);
n = ab.*m - b.*t - a.*(~t);
x1 = n./(n+1);
x2 = 1 - x1;
end

La pregunta está cerrada.

Etiquetas

Aún no se han introducido etiquetas.

Community Treasure Hunt

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

Start Hunting!

Translated by