Clear Filters
Clear Filters

Plotting from mat file

1 view (last 30 days)
Emil Eterovic
Emil Eterovic on 20 Jan 2017
Commented: Emil Eterovic on 21 Jan 2017
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

Accepted Answer

Karsten Reuß
Karsten Reuß on 20 Jan 2017
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 Comments
Emil Eterovic
Emil Eterovic on 20 Jan 2017
Thank you for a quick answer. This helps alot. Cheers
Emil Eterovic
Emil Eterovic on 21 Jan 2017
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?

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!