
Symbolic toolbox help using solve command
조회 수: 3 (최근 30일)
이전 댓글 표시
I have the following simple code and Im not sure how else to solve it for more than one equation, the variable hl and hr can change at any time so I want matlab to automatically solve for the different equation im assuming its something simple that i have missed, thanks in advance kyle
hl = 1;
hr = 0.1;
g=9.81;
syms s
geneqn = s*((s - ((g*hr)/(4*s))*(1+(sqrt(1+((8*s^2)/(g*hr)))))) + 2*(sqrt(((g*hr)/2)*(sqrt(1+((8*s^2)/(g*hr)))-1))) - 2*sqrt(g*hl));
S = solve('geneqn=0')
s=0 << %I know that this is not correct
댓글 수: 0
채택된 답변
Andrei Bobrov
2012년 3월 12일
hl = 1; hr = 0.1; g=9.81;
syms s
geneqn = s*((s - ((g*hr)/(4*s))*(1+(sqrt(1+((8*s^2)/(g*hr))))))...
+ 2*(sqrt(((g*hr)/2)*(sqrt(1+((8*s^2)/(g*hr)))-1))) - 2*sqrt(g*hl));
out = solve(geneqn,s)
on my PC:

추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!