Hi,
I have an equation with x and y are variable and a, b and d are constant.
with x =[1:1:10];
How to define y variable?

댓글 수: 2

KSSV
KSSV 2016년 11월 21일
You want to solve for y?
ly
ly 2016년 11월 21일
편집: ly 2016년 11월 21일
I want to know y based on x =[1:1:10];
Example:
x=1, y=???
x=2, y=???

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2016년 11월 21일

0 개 추천

As I posted in your earlier question,
y1 = @(b, d, x) -b .* (exp(-(2/3) .* lambertw(-3 .* (b.^3 ./ a.^2).^(1/2) .* d.^3 ./ x.^3)) .* d.^2 - x.^2) ./ x.^2
y2 = @(b, d, x) -b .* (exp(-(2/3) .* lambertw(3 .* (b.^3 ./ a.^2).^(1/2) .* d.^3 ./ x.^3)) .* d.^2 - x.^2) ./ x.^2;
Now use y1(b, d, 1:10) and y2(b, d, 1:10)
Note: you will need the Symbolic Toolbox for lambertw, but see also https://www.mathworks.com/matlabcentral/fileexchange/43419-the-lambert-w-function

댓글 수: 3

ly
ly 2016년 11월 21일
Thanks,
How to get y1, y2 from equation.
Walter Roberson
Walter Roberson 2016년 11월 21일
Symbolic toolbox with x symbolic, and solve() . You can then matlabFunction() and pass the numeric x values in .
The y1 and y2 are there because there are two solutions.
ly
ly 2016년 11월 21일
syms a b d x y
Y=solve( '1/a*(b-y)^1.5-log(b/x)+0.5*log(1-y/b)=0',y);
Y
But Y is [empty sym], I use Matlab R2011b

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

KSSV
KSSV 2016년 11월 21일

0 개 추천

doc solve.

댓글 수: 1

ly
ly 2016년 11월 21일
Yes, but "solve" only get 1 value y from 1 value x.
My case, x is matrix adn I want y is a matrix like x.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

질문:

ly
2016년 11월 21일

댓글:

ly
2016년 11월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by