I have an assignment on MATLAB and have this problem where I have an array: plot_handles = [] and should store different plot handles there.
A main function called 'mainMeny' creates this plot_handles = [] then calls another function plot_handles = createPlot(plot_handles)
And I am to create this createPlot function.
This createPlot function is supposed to ask the user for some mathematical function f(x) and create a plot. The handle for this created plot is to be stored in plot_handles and returned to mainMeny and thus update the plot_handles = [] array to the array that now contains a plot handle. This array should thus contain several plot handles.
the mainMeny function can also call other functions that can change the title of the figure, the width of lines etc, and should be able to choose which plot (each plot plotted on different figures) that we want to change etc.
I just dont seem to be able to store plot handles in an array. Intuitively, I do it like this:
plot_handles(index) = plot(x,y) % or something like that.
But that only makes plot_handles contain some number in that index.