I have 2 imported columns from excel (time and value), that contain more than 10000 rows, I plotted them and also the average of the whole values.
Now I want to plot both the time on the x axis and the values on the y axis with the average line (see second code) in one figure, I get the following error:
Values plotted against x-axis must be categorical values. To create categorical values, use the categorical function.
when I convert the value to a categorical one, it says: " Invalid data type. First argument must be numeric or logical."
Can Anyone tell me where the problem can be?
%the first correct code:
nexttileplot(time,value)nexttileplot([0 size(value,1)],[avg avg], 'y-', 'LineWidth',2);%The second one where I get the error:
nexttilehold onplot(time,value)plot( [0 size(value,1)],[avg avg], 'y-', 'LineWidth',2);hold off
Best Answer