Empty Sym when using vpasolve-operator.

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?

Antworten (1)

Torsten
Torsten am 20 Jan. 2022

0 Stimmen

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 Kommentare

Iver Brekken
Iver Brekken am 20 Jan. 2022
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 am 20 Jan. 2022
Bearbeitet: Torsten am 20 Jan. 2022
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 20 Jan. 2022

Bearbeitet:

am 20 Jan. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by