I am trying to visualize data in matlab with this file (I have attach above).
How to visualize the data with the x-axis is the "date2", dan the y-axis is "mean_METs"?

 Respuesta aceptada

Star Strider
Star Strider el 16 de Jul. de 2018
Editada: Star Strider el 16 de Jul. de 2018

0 votos

With your data, use the structure field reference with your ‘ee_moderate’ table:
d = load('ee_moderate.mat');
ee_moderate = d.ee_moderate;
figure
plot(ee_moderate.date2, ee_moderate.mean_METs)
xlabel('date2')
ylabel('mean\_METs')
grid

4 comentarios

Agnes Palit
Agnes Palit el 16 de Jul. de 2018
Thank you very much, do you have idea how to plot column 4,5 in the bar chart like the picture that i attached?
Star Strider
Star Strider el 16 de Jul. de 2018
My pleasure.
That image is impossible to interpret in the context of your data. I am not certain what you want.
Try this:
G = findgroups(month(ee_moderate.date2), day(ee_moderate.date2));
TEEsum = splitapply(@sum, ee_moderate.TEE,G);
AEEsum = splitapply(@sum, ee_moderate.AEE,G);
date2day = splitapply(@mean, day(ee_moderate.date2), G);
figure
bar(date2day, [TEEsum AEEsum])
xlabel('''date2'' Day')
legend('TEE', 'AEE', 'Location','NE')
Experiment to get the result you want.
Agnes Palit
Agnes Palit el 16 de Jul. de 2018
Thank you very much for the idea.
Star Strider
Star Strider el 16 de Jul. de 2018
As always, my pleasure.

Iniciar sesión para comentar.

Más respuestas (1)

KARSH THARYANI
KARSH THARYANI el 16 de Jul. de 2018

0 votos

Hi,
Please follow the examples here
In short, you need to load your .mat file and the variables will show up in your workspace, if loaded successfully.
Then, you can plot them.
To plot, you can refer to some examples here
So, for instance if you have a column vector in X and the values corresponding to it in Y, you can do
plot(X, Y);

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Preguntada:

el 16 de Jul. de 2018

Comentada:

el 16 de Jul. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by