MATLAB: A function that draws a plot and uses an input for the title of the plot

MATLABplot

In my Livescript called test.mlx, I have variables
days
temperatures
I now want to write a function m file that outputs a plot with specification as
plot(days, temperatures)
legend('temperatures')
title('Figure 4. Temperatures')
Then, what I did is to write a function m file called plot1.m
function plot_test(series1, series2, figurenumber)
plot(series1, series2)
legend('series2')
end
Then how should one understand the title part?

Best Answer

figurenumber = 4 ;
title_name = ['Figure',num2str(figurenumber),'.Temperatures'] ;
title(title_name)