MATLAB: Plotting temperature vs date, which will be a combination of two array

arrayarrayscell arraysdatenumMATLABplotplotting

Situation: Trying to plot temp Vs (month/year) Data given: temp, month, year are all arrays with single column Code used:
dates=datenum([finalmonth,finalyear]);
plot(dates,finaltemp,'b.');
datetick('x','mmmm','keepticks')
Problem with this code: Its is plotting all the point at just one point on x-axis

Best Answer

dates=datenum([finalmonth,finalyear]);
isn't correct form for datenum, _"...A partial date vector has three elements, specifying year, month, and day." You've got month and year reversed no day (pick one, "1" is a good choice for plotting).
Use
dates=datenum(finalyear, finalmonth, 1);
instead.