How to plot each row separately

Hello everybody, I need your help, please. I have a table "T"(double) with 189 rows and 9 columns (variables) and I have to plot Var2 in function of V3, Var4 in function of Var5 and so on in the same graph but each row separately to a different graph (I guess I have to use 'clf'). The attached image is what I want as a result ( I did it with excel). Thank you in advance!

답변 (1개)

KSSV
KSSV 2018년 9월 20일

0 개 추천

A = rand(50,3) ;
x = 1:size(A,1) ;
figure
hold on
for i = 1:size(A,2)
plot(x,A(:,i))
end
legend
figure
plot(x,A)
legend

댓글 수: 4

Nivodi
Nivodi 2018년 9월 20일
편집: Nivodi 2018년 9월 20일
KSSV, I was confused... If you have the time I would like you to be a little bit more analytical...
for i=1:size(T,2)
plot(????,T(:,i))
end
my table's name is, let's say, "T" . What is the 'x' that you wrote?
Nivodi
Nivodi 2018년 9월 20일
편집: Nivodi 2018년 9월 20일
I replaced "A" with my table but it didn't work.
KSSV
KSSV 2018년 9월 20일
You need not to give x axes data. In such case, plot will be wrt to indices.
KSSV
KSSV 2018년 9월 20일
YOur Table should be called as T.(i)

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

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2018년 9월 20일

댓글:

2018년 9월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by