Is the Order of Function Evaluation Guaranteed when Function Outputs are Concatenated into an an Array?
Suppose I call two functions within concatenation into an array
A = [ones(1,2),zeros(1,2)]
In this case, the order in which ones and zeros are evaluated doesn’t matter as far as the result is concerned.
But what about when there is dependence between the two (or more) functions whose outputs are being concatenated:
A = [figure,plot(1:3)]
Is there any guarantee that the call to figure is evaluated and the figure created before the call to plot so that the plotted result is in the newly created figure?
Does the answer change if creating a cell array?
A= {figure,plot(rand(2))}Suppose I call two functions within concatenation into an array
A = [ones(1,2),zeros(1,2)]
In this case, the order in which ones and zeros are evaluated doesn’t matter as far as the result is concerned.
But what about when there is dependence between the two (or more) functions whose outputs are being concatenated:
A = [figure,plot(1:3)]
Is there any guarantee that the call to figure is evaluated and the figure created before the call to plot so that the plotted result is in the newly created figure?
Does the answer change if creating a cell array?
A= {figure,plot(rand(2))} Suppose I call two functions within concatenation into an array
A = [ones(1,2),zeros(1,2)]
In this case, the order in which ones and zeros are evaluated doesn’t matter as far as the result is concerned.
But what about when there is dependence between the two (or more) functions whose outputs are being concatenated:
A = [figure,plot(1:3)]
Is there any guarantee that the call to figure is evaluated and the figure created before the call to plot so that the plotted result is in the newly created figure?
Does the answer change if creating a cell array?
A= {figure,plot(rand(2))} function evaluation, concatenation MATLAB Answers — New Questions









