Double "for loop" with an integral of hundle functions, problem.
1 view (last 30 days)
Show older comments
Kraka Doros on 15 Jun 2022
Commented: Kraka Doros on 18 Jun 2022
>> %assing two handle functions to a column with two rows
>> % gives me a 2x1 cell array, with @(t)3*t+1 in the first row
>> % and @(t)1.5*t+0.5 in the second row.
>> % I will use this cell array in a double "for loop" to produce something
>> % This, gives me 2 resaults, in a 2x1 sym. The first resault is :
>> % and the second is :
>> % My problem is that, actually, i have more than 10 handle functions (lets say 10), and
>> % i do not want to write each one, every time. I want to copy them (from another software) and
>> % past in an array (in Matlab). And then, use this array as a source to call these 10 functions in the
>> % double "for loop".
>> % But i cannot make an array of 10 cells, including the 10 hundle functions. They comes
>> % out as "sym". And this, couse problem when i use it in the double "for loop". It gives me
>> % errors like : ........The following error occurred converting from sym to double:
% Error using symengine (line 59)
% DOUBLE cannot convert the input expression into a double array.
% If the input expression contains a symbolic variable, use VPA.
% Any help please
Torsten on 15 Jun 2022
f=@(t)[-7*t+25 %insert (by copy and paste), in the [ ], 10 functions. (Copy %from another software)
result = integral(f,0,1,'ArrayValued',1);
More Answers (0)
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!