Empty Sym when using vpasolve-operator.

조회 수: 1 (최근 30일)
Iver Brekken
Iver Brekken 2022년 1월 20일
편집: Torsten 2022년 1월 20일
e = [0.05:0.05:1];
syms tp
eqn = 900-e.*5.67*10^(-8)*tp^4-20*(tp-293)==0;
S = vpasolve(eqn,tp)
I get the following message: Empty Sym: 0-by-1 when running this. Any changes I can make?

답변 (1개)

Torsten
Torsten 2022년 1월 20일
e = [0.05:0.05:1];
syms tp
for i=1:numel(e)
eqn = 900-e(i)*5.67*10^(-8)*tp^4-20*(tp-293)==0;
S{i} = vpasolve(eqn,tp);
end
  댓글 수: 2
Iver Brekken
Iver Brekken 2022년 1월 20일
Thank you! I want to plot S vs e (e at x-axis), and use the second element of every cell in S to do so. Any help?
Torsten
Torsten 2022년 1월 20일
편집: Torsten 2022년 1월 20일
e = [0.05:0.05:1];
syms tp
for i=1:numel(e)
eqn = 900-e(i)*5.67*10^(-8)*tp^4-20*(tp-293)==0;
S(i) = double(vpasolve(eqn,tp));
end
plot(e,S)
end
Maybe you should use "roots" instead of "vpasolve" because your polynomial equation has 4 zeros.

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

카테고리

Help CenterFile Exchange에서 Formula Manipulation and Simplification에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by