Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Making a graph from my Matrix

조회 수: 1 (최근 30일)
Jay Stewart
Jay Stewart 2018년 9월 6일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a matrix of 29 x 5 that I am trying to plot a graph with. The first 4 columns are the data points while the last column is a classifier of 1 and 0 to separate the data into Group A and Group B. The graph needs to have the first 4 columns to act as the y axis, while the x-axis is time points 1,4,7, and 10. Each row needs to have its own line connecting the data points and the color of the lines needs to be either red for group A or blue for Group B. How would I make this?
  댓글 수: 1
madhan ravi
madhan ravi 2018년 9월 6일
Can you upload the matrix?

답변 (1개)

jonas
jonas 2018년 9월 6일
편집: jonas 2018년 9월 6일
A is your matrix
x=[1 4 7 10];
plot(x,A(A(:,5)==1,1:4),'r')
plot(x,A(A(:,5)==0,1:4),'b')
  댓글 수: 2
jonas
jonas 2018년 9월 6일
편집: jonas 2018년 9월 6일
That's odd. I'm not having any trouble with it. Try running my attached m-file.
jonas
jonas 2018년 9월 7일
Any success?

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by