sum of two inline function
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi, i want to sum two inline function. the functions that i want to sum are following;
f1=0;
for i=1:20
f2=f2(x(1),x(2),x(3))
f1=f1+f2
end
how can i do by using inline function? the following is true??
f1=inline('0','x(1)','x(2)','x(3)');
for i=1:20
f2=inline('f2(x(1),x(2),x(3)','x(1)','x(2)','x(3)') f1=inline(['(' char(f) ')+(' char(flog) ')']);
end
Can anyone help me? Because i use this last summation function for fminsearch
1 Commento
Matt J
il 16 Gen 2013
You should probably be using Anonymous Functions as opposed to inline functions. Also, if this is for fminsearch, you should probably be writing f1 as a function of a 3x1 vector instead of 3 separate variables.
Vedere anche
Categorie
Scopri di più su Function Creation in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!