MATLAB: Plotting from mat file

MATLABplotting

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

Best Answer

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))