Hi there, I have many variables made from doubles. I would like to plot certain variables against the date which is also made of doubles in the format yyyymmdd. So far i have:
function [out1] = simpleplot(variable,depthvar,mindepth,maxdepth,datevar,startdate,enddate,xlab,ylab);depth = find(depthvar>mindepth & depthvar<maxdepth & ~isnan(variable));datedepth=datevar(depth);variable_depth=variable(depth);plot(datedepth, variable_depth,'sk--')xlabel(xlab);ylabel(ylab);axis([startdate enddate min(variable_depth) max(variable_depth)]);end
However because my dates are yyyymmdd not in decimal year the plot has large gaps in it.
How can i convert the date doubles to decimal year within the function and also to have the x axis show date in a meaningful way like yy/mm rather than decimal year.
thank-you
Best Answer