In this post, I share a numerical Jacobian matrix calculation method with matlab code.
Actually there is a function in Matlab inherently, but it is very complex. ( look at the function, NumJac ), So I made a very simple version. I wish this can help you.
1. NumJacob.m : main file it generates jacobian matrix.
2. Demo.m : demo file
3. test_func.m : test function to show its demo
The below is a simple example.
>> x0=[0;1]; other_param=[1;2];
Because the code is very easy, probably you can easily understand the codes.
Then, good luck ^^
if you have any question, please leave me a comment below.
Added on Feb 07. 2014
I am uploading another demo file to give a solution of Mahmudul’s request (for detail, see the comment).
This demo file is to get a numerical Jacobian for the below function
y1′ = y2*y3; y1(0) = 0
y2′ = -y1*y3; y2(0) = 1
y3′ = -0.51*y1*y3; y3(0) =1
I am Youngmok Yun, and writing about robotics theories and my research.