필터 지우기
필터 지우기

unable to plot graphs

조회 수: 1 (최근 30일)
Aiden James
Aiden James 2020년 9월 4일
댓글: Aiden James 2020년 9월 17일
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

채택된 답변

Star Strider
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
Star Strider
Star Strider 2020년 9월 10일
As always, my pleasure!
Aiden James
Aiden James 2020년 9월 17일
sir,may be you can help me ,plesae refer following link for my query-
How to plot contour with constraints
https://in.mathworks.com/matlabcentral/answers/594670-how-to-plot-contour-with-constraints?s_tid=srchtitle

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by