i need to find variable x and the error is " Undefined function or variable 'x'. "
조회 수: 1 (최근 30일)
이전 댓글 표시
>> a=0:2:20; >> y=((1/x)*(exp(-x/a)))+((1/a)*(Ei(-x/a)))==1
댓글 수: 0
채택된 답변
Mischa Kim
2017년 11월 11일
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)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!