Double Integration Script at MatLab (Em português e inglês)

AndrePE20

New member
I did this script at Matlab to calculate the number of pieces that i have to buy for my company.
This model is padronized, so I can't change it, I just need to fix the method to integrate.
Thankful if any1 can help me.

Fiz esse script aí, e não posso mudar a função a ser integrada, só tenho dúvidas no procedimento de integração.
Grato por qualquer ajuda.


clear
a=input('alfa=? '); %taxa de falhas
N=input('N=? '); %número de itens amostrais
EMS=1-a; %Valor esperado da margem de segurança
P=0;
i=0;
J=0;
B=0;
Soma=0;
syms x y;
while B<=EMS
    P=((N*x*y).^i*exp(-N*x*y)/factorial(i));
    J=int(int(P(x,y),0,inf),0,inf);
    Soma=Soma+J;
    B=double(Soma);
    i=i+1;
end
i=i-1;
disp('O número ótimo de sobresalentes é: ');
disp(i);

O erro apresentado é: (The MatLab error is:)

??? Error using ==> subsindex
Function 'subsindex' is not defined for values of class 'sym'.

Error in ==> DuplaFalha at 13
    J=int(int(P(x,y),0,inf),0,inf);
 

Welcome to EDABoard.com

Sponsor

Back
Top