Hi everyone,
I am trying to create a plot with subplots within a loop. The code so far is:
x = randn(100,13);D = 1966dis = 3[T N] = size(x);for i = 1 : NVARNAMES{i} = i;endtime = datetime(D,1:T,1);figure;for k = 1:N subplot (ceil(N/dis),dis,k) filename = plot( time' , x(:, k ) ); xlim(datenum([min(time) max(time)])) title ( VARNAMES(k)); hold onend
But I get an Error message ''Error using xlim (line 31)
Limits must be a 2-element vector of increasing datetime values.''
Could you please point out where is the mistake?
Best Answer