i need to find variable x and the error is " Undefined function or variable 'x'. "

alireza farrokh

alireza farrokh (view profile)

님이 질문을 제출함. 11 Nov 2017
최근 활동 alireza farrokh

alireza farrokh (view profile)

님이 댓글을 추가함. 11 Nov 2017
Mischa Kim

Mischa Kim (view profile)

님이 답변을 채택함.
>> a=0:2:20; >> y=((1/x)*(exp(-x/a)))+((1/a)*(Ei(-x/a)))==1

로그인 to comment.

답변 수: 1

Mischa Kim (view profile)

on 11 Nov 2017

A couple of things. In the code you show Ei is not defined and it looks like you need to solve the equation for different a.
Just to get you started: you could use fsolve inside a loop to step through all the different values for a. In the following I picked random values for the parameters to show you how to set up the problem:
a = 1; Ei = 1;
fun = @(x) ((1/x)*(exp(-x/a)))+((1/a)*(Ei*(-x/a))) - 1;
x0 = 1;
xs = fsolve(fun,x0);
fun(xs)

alireza farrokh

alireza farrokh (view profile)

on 11 Nov 2017
"Ei=int((exp(t))/t,-x/a,inf);" and "a" should be these numbers:0 2 4 6 8 10 12 14 16 18 20

로그인 to comment.

Translated by