Create cell array of handle functions, which have been created from 2x1 double arrays
1 view (last 30 days)
% i want to create an array of 2x1 cells, for example :
% So i write :
% But i do not want to write the two functions, manually.
% I want to create this array, from pre-existing data,
% for example :
% The above gives me, two 2x1 double array.
% a =
% b =
% Now, if i will write :
>> for ff=1:2
% i will receive a 2x1 cell :
% f =
% instead of receiving :
% f =
% Any help please, how to create it.
More Answers (1)
patrick1704 on 3 Jul 2022
I am not sure if I understand the problem correctly because once you evaluate the function handle Matlab, you will get the desired result. So what is the point of having it explicity written in the code?
Matlab will store the variables a and b as well as the index ff in the local function workspace, so you can even do something like this once you created the handles:
>> clear a b
The fact that Matlab does not do the actually value-representation is not really resolvable from my perspective, except for maybe when doing some ugly eval expression:
However, I would not recommend it as the other solution works perfectly fine.