HOW TO PLOT X VS Y AT DIFFERENT Z

조회 수: 7 (최근 30일)
Abdulrahman Mohamed
Abdulrahman Mohamed 2022년 6월 13일
답변: Mathieu NOE 2022년 6월 14일
I want to plot the density vs pressure at different Temprature
How can i make this plot as the density function of pressure at fixed temprature
for example
P=200:10000;%the pressure range
T=100:600, % temprature range
p= (x*P+T) % density equation it is not real one it is example
I wnat to tell the matlab calculate density at P from 200:1000 at fixedTemp 1 then move to at fixed temp and at the end I want to plot all the data in same graph

답변 (1개)

Mathieu NOE
Mathieu NOE 2022년 6월 14일
hello
maybe this ?
NB : I used large steps for pressure and temperature to avoid creating very large arrays - adapt to your needs
clearvars
P=200:1000:10000;%the pressure range (NB : pressure steps = 1000)
T=100:100:600; % temperature range (NB : temperature steps = 100)
figure(1)
hold on
for ci = 1:numel(T)
d = (0.3*P+T(ci)); % density equation it is not real one it is example
str_leg{ci} = ['Temp. = ' num2str(T(ci)) , ' deg C'];
plot(P,d);
end
legend(str_leg);

카테고리

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

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by