Plotting data from table

5 vues (au cours des 30 derniers jours)
Elia
Elia le 20 Déc 2013
Commenté : Elia le 21 Déc 2013
how can i plot every column ( of a 2 columns table )as a function of time in two different axes ?

Réponses (2)

José-Luis
José-Luis le 20 Déc 2013
  6 commentaires
Elia
Elia le 20 Déc 2013
gui uitable
José-Luis
José-Luis le 20 Déc 2013
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));

Connectez-vous pour commenter.


Wei
Wei le 20 Déc 2013
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 commentaire
Elia
Elia le 21 Déc 2013
a bracket is missing in the first code-line , it didn't work , i become on command window Undefined function or variable 't1'.

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by