Hi everyone,
I know there are many people who have uses function "lsqnonlin" for optimization. Currently, I am encountering a problem relating calculation of Jacobian matrix for this function.
My problem is described as follows:
I have a vectorvalue function F consists of n=1000 scalevalue functions. Total variables for F is about m=700.
1) I define a mx1 symbolic array of symbolic variables: X=[X1; X2; ...; X700].
2) Then, i compute symbolic gradient : grad_F = jacobian(F,X).
3) After step 2, i have Jacobian matrix nxm of F in Symbolic Expression, for example
grad_F = [2*X1 +5*X7  35*X550;
4*X12 + 56*X45;
.....
67*X1  45*X15*X17]
Now, if i want to obtain Jacobian matrix of F with a real variable y =[1; 2;...;700], how can i do ?
Of course, we can use "for loop" by running row by row of grad_F and replace a symbolic variable Xi by a respective real variable y(i) at each position in this matrix. Uhmm, It takes so long time to accomplish just for one time.
If you have any solution, please help me.
Thanks in advance,
Toan
