solve an expression and plot
이전 댓글 표시
Suppose, for each alpha, I have to find a delta which is the highest positive root of the equation A^2-4*B*beta=0. The expression of A, B are given in terms of alpha and delta. How to get that and how to plot alpha vs delta plot.
beta=0.85;gamma=.15;theta=0.1;
alpha=.303:.001:5
syms delta
A=-alpha*beta + alpha.*delta + gamma*beta + beta;
B=alpha.*theta*(beta -delta) + gamma*beta;
rr=solve(A^2-4*B*beta == 0)
plot(alpha,rr)
채택된 답변
추가 답변 (1개)
Azzi Abdelmalek
2013년 6월 3일
편집: Azzi Abdelmalek
2013년 6월 3일
beta=0.85;
gamma=.15;
theta=0.1;
alpha=(.303:.001:5)'
syms delta
A=-alpha*beta + alpha*delta + gamma*beta + beta;
B=alpha*theta*(beta -delta) + gamma*beta;
for k=1:numel(A)
rr{k}=solve(A(k).^2-4*B(k)*beta == 0);
end
댓글 수: 2
Walter Roberson
2013년 6월 3일
After which you would need the step of finding the highest positive root for each rr{:}
Atom
2013년 6월 4일
카테고리
도움말 센터 및 File Exchange에서 Special Functions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!