Azzera filtri
Azzera filtri

Plotting from mat file

1 visualizzazione (ultimi 30 giorni)
Emil Eterovic
Emil Eterovic il 20 Gen 2017
Commentato: Emil Eterovic il 21 Gen 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

Risposta accettata

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

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by