Plotting from mat file

1 次查看(过去 30 天)
My problem is plotting from filename.mat which has four columns:years,months,days and value for that date. Howdo i separate certain data from such a file,if i want for example plot only the values for 1st and 2nd mont of every year? mat file is included

采纳的回答

Karsten Reuß
Karsten Reuß 2017-1-20
If you want only first and second month in your variables you can do this:
POSTAJE_CLM_hvar(POSTAJE_CLM_hvar(:,2)<3,:)
Alternatively:
POSTAJE_CLM_hvar(POSTAJE_CLM_hvar(:,2)==1 | POSTAJE_CLM_hvar(:,2)==2,:)
If you want to plot the corresponding values only for first and second month of year for example in the 5th column:
plot(POSTAJE_CLM_hvar(POSTAJE_CLM_hvar(:,2)==1 | POSTAJE_CLM_hvar(:,2)==2,5))
  2 个评论
Emil Eterovic
Emil Eterovic 2017-1-20
Thank you for a quick answer. This helps alot. Cheers
Emil Eterovic
Emil Eterovic 2017-1-21
Hello, i now have a different situation that i cannot figure out with the same mat file. I have to take the value of the 12th month of a year(example 1999),value of the first and second month of 2000 and calculate the mean values of those so that those three will make one point on my graph. And repeat that for every year. FYI 12th month of 1999 and 1st and 2nd month of 2000 will be presented on the graph as for year 2000, because i have to calculate for the winter of that year,which includes december of the year before. Any pointers on this?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by