필터 지우기
필터 지우기

how can i plot the values of 2 variables against eachother from the determinant of a martix when det ==0?

조회 수: 2 (최근 30일)
I am trying to plot the answers for variables o and e from my code when the det of my matrix ==0. when i use solve i get struct results back that i cannot seem to plot.
syms e o n
c=0;
g(n)=e/(2*(o+(1i*n*c)-((n)^2)));
f=[1 g(3) 0 0 0 0 0; g(2) 1 g(2) 0 0 0 0; 0 g(1) 1 g(1) 0 0 0; 0 0 g(0) 1 g(0) 0 0; 0 0 0 g(-1) 1 g(-1) 0; 0 0 0 0 g(-2) 1 g(-2); 0 0 0 0 0 g(-3) 1];
F=det(f)==0;
solo=solve(F, o, 'ReturnConditions', true);
sole=solve(F, e, 'ReturnConditions', true);

채택된 답변

John D'Errico
John D'Errico 2020년 6월 16일
편집: John D'Errico 2020년 6월 16일
First, need I point out just how bad of an idea is it to name a variable a lower case o? This is just asking to produce buggy code, when you misread or mistype o as 0.
Regardless, Just set
F = det(F);
If you look at F, you will see it is essentially a high degree (greater than 4 is all that matters) polynomial. So algebraic solutions will often be difficult to find.
Then use fimplicit to plot the solution locus. Settign it to zero does not help. In fact that will cause problems, and fimplicit does that implicitly anyway.
fimplicit(F)
xlabel 'e'
ylabel 'o'
The solo and sole calls to solve do nothing useful, since no algebraic solutions will generally be found.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by