Separate data to plot as multiple lines

조회 수: 5 (최근 30일)
Desmond
Desmond 2024년 8월 22일
댓글: Star Strider 2024년 8월 22일
It has been a while since I have touched matlab, and as such I can't quite figure out how to solve this issue. Essentially, I have data being created to monitor a device. This data is in an excel sheet, and I have imported that excel sheet into matlab. The table is then parsed to only include certain data for creation of each plot. My problem is when plotting the table, which has multiple runs included. An example of such I will be including below:
run time var1
0 0 0
0 1 1
0 2 ...
1 3 ...
1 4 ...
2 5 ...
3 6 50
My question is how would I split this data so that I can plot each run as a seperate line on the same graph? So in this case, it would be a line plot showing the 4 runs (0-3) as separate lines, comparing time to the change in the variables. Thank you.

채택된 답변

Star Strider
Star Strider 2024년 8월 22일
I don’t completely understand what you want to do, however I refer you to findgroups and splitapply to start with. There are other approaches, however those might be the easiest to work with. Their documentation pages might also suggest other functions that could be more appropriate.
  댓글 수: 2
Desmond
Desmond 2024년 8월 22일
This was precisely what I was thinking of, using findgroups. Thank you so much!
Star Strider
Star Strider 2024년 8월 22일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by