plot between two variables

조회 수: 1 (최근 30일)
almohanned alsufyani
almohanned alsufyani 2023년 5월 31일
답변: Torsten 2023년 5월 31일
Hi, I want to plot the (PR) vs. the (PR_ave) where (PR)changes daily while (PR_ave) is the aferage of the (PR), please change the code below to the desired goal, thank you
PR = (Md_MSF_seclatent_steam)./(Ncqsum); % Performance Ratio PR_ave=sum(PR)/365; % Average Performance Ratio plot(PR,PR_ave); ylabel("PR") xlabel("Days") title("Performance Ratio profile")
  댓글 수: 2
Constantino Carlos Reyes-Aldasoro
What exactly is the problem for which you need help?
almohanned alsufyani
almohanned alsufyani 2023년 5월 31일
I want the code to produce a plot like this.

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

답변 (1개)

Torsten
Torsten 2023년 5월 31일
Use
plot(1:365,[PR;ones(1,365)*PR_ave]);
instead of
plot(PR,PR_ave);
if PR is a row vector, or
plot((1:365).',[PR,ones(365,1)*PR_ave]);
if PR is a column vector.

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by