how can i plot every column ( of a 2 columns table )as a function of time in two different axes ?

답변 (2개)

José-Luis
José-Luis 2013년 12월 20일

0 개 추천

doc plotyy

댓글 수: 6

Elia
Elia 2013년 12월 20일
i mean how can i get the data from the table and plot it ,how will the code look like ?
What have you tried so far? Where's your time data? What's wrong with:
plotyy(x1,y1,x2,y2)
Elia
Elia 2013년 12월 20일
편집: Elia 2013년 12월 20일
i made a figure with 2 axes , a table with 2 columns , i want to plot each column as function of time in two different axes , not in one with 2 y-axes . i tried to get the data of table using this command
data=get(handles.table,'data')
plot(axes1,data(:,column's name ))
i tried this too
M=table(:,column's name ) % as matrix
plot(axes1,t,M);
both ways didn't work , they are the only ways how i thought to plot data from the table
José-Luis
José-Luis 2013년 12월 20일
I am sorry, what do you mean by a table? How did you make it?
Elia
Elia 2013년 12월 20일
gui uitable
figure(1)
t = uitable;
set(t,'Data',rand(10,3));
data = get(t,'Data');
figure(2)
aH(1) = subplot(1,2,1);
aH(2) = subplot(1,2,2);
plot(aH(1),data(:,1),data(:,2));
plot(aH(2),data(:,1),data(:,3));

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

Wei
Wei 2013년 12월 20일

0 개 추천

You need to convert the table data into numbers, and you need the time for the plot. Try this:
data = str2double(get(handles.table,'data');
plot(axes1, t1, data(:,column's name1));
plot(axes2, t2, data(:,column's name2));

댓글 수: 1

Elia
Elia 2013년 12월 21일
a bracket is missing in the first code-line , it didn't work , i become on command window Undefined function or variable 't1'.

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

카테고리

질문:

2013년 12월 20일

댓글:

2013년 12월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by