MATLAB: Non numeric data is not supported in ‘Line’

graph plotting

error in timeseries/plot
p=plot(ax,time, data,varargin(:));
my coding is
plot(t,f1,'linewidth',2) %%%%% my coding (2016 version matlab)
graph has not obtained

Best Answer

When you pass a timeseries to plot(), you must pass only the time series, or else the time series and a line specification. For example,
plot(f1)
plot(f1, 'r-')
It is not permitted to pass in two different time series in a single call. If you want to plot two different time series then plot() one, then hold on then plot() the other one.
timeseries objects contain both time and data associated with that time. When you plot() a timeseries object, then the time is used as the x axis and the data is used as the y axes.