unable to plot graphs
1 次查看(过去 30 天)
显示 更早的评论
I have following code want cp Vs ct plot. How to plot it
clc;
clear all;
close all;
format long;
syms cp positive
for ct=0:0.05:1;
eqn = (1.38/(cp/ct)^2)-0.4151-(ct^3/cp^2) == 0
Root=vpasolve(eqn,cp,[0 1])
end
0 个评论
采纳的回答
Star Strider
2020-9-4
Try this:
format long;
syms cp positive
ctv=0:0.05:1;
for k = 1:numel(ctv)
ct = ctv(k);
eqn = (1.38/(cp/ct)^2)-0.4151-(ct^3/cp^2);
Root{k}=double(vpasolve(eqn,cp,[0 1]));
end
Root{cellfun(@isempty, Root)} = NaN;
figure
plot(ctv, [Root{:}])
grid
.
5 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!