필터 지우기
필터 지우기

BMI graph, 3 variables on 2D graph

조회 수: 1 (최근 30일)
karolcia01
karolcia01 2017년 12월 28일
댓글: Aryan 2022년 10월 13일
How can i create a graph in GUI (it's BMI graph), where x is from 0 to 2.5, y is from 0 to 650 and i want to draw a few lines let's call them "c" (y/x^2=c) and i would like to draw lines for c=16.5,18,25,30,35 and 40. How can i do that to display 3 variables on 2D graph and i only want to count c, x and y should just change by 0.1 and 1.
  댓글 수: 2
karolcia01
karolcia01 2017년 12월 29일
I want to achieve something exactly like here: https://www.mathworks.com/matlabcentral/answers/269143-legend-does-not-appear-in-my-report-with-report-explorer#answer_297962?s_tid=prof_contriblnk
Aryan
Aryan 2022년 10월 13일
@karolcia01please advise your code for this question

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

답변 (1개)

ANKUR KUMAR
ANKUR KUMAR 2017년 12월 30일
If you want to use 3 variables on 2D plot, then you can use contour or contourf or surf or surfc.
clc
clear
lat=(1:10)';
lon=(1:20)';
rf=randi(20,10,20);
figure()
contourf(lon,lat,rf,'linecolor','none');
figure()
[x,y]=meshgrid(lon,lat);
a=surf(x,y,rf,'FaceAlpha',0.5,'EdgeColor', 'none')
figure()
surfc(x,y,rf,'FaceAlpha',0.5,'EdgeColor', 'none')

카테고리

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