Split the data into group then graph them

조회 수: 2 (최근 30일)
Yaser Khojah
Yaser Khojah 2020년 2월 10일
댓글: Star Strider 2020년 2월 10일
I have a big matrix as
[ENPV, SD, R];
I would like to split R into 3 groups based on criteria as
Group 1 when R is between [0 10]
Group 2 when R is between [11 20]
Group 3 when R is between [21 30]
Then, I want to draw them.
I tried something as below but did not work
[counting,group] = hist(R,3);
G = findgroups(R,group)
figure
gscatter(SD, ENPV, G)
Anyway to help wtih this please.

채택된 답변

Star Strider
Star Strider 2020년 2월 10일
If you have R2015a or later, the discretize funciton may do what you want:
group = discretize(R, [0 10 20 30]);
  댓글 수: 2
Yaser Khojah
Yaser Khojah 2020년 2월 10일
Thank you so much anywya, I can change the maker size in the gscatter?
Star Strider
Star Strider 2020년 2월 10일
As always, my pleasure!
See the siz section in gscatter documentation.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Identification에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by