Getting a formula/function out of a finite pair of numbers
2 次查看(过去 30 天)
显示 更早的评论
Hi everybody.
I use a machine which is able to move in 3 dimensions( x , y , z ).I define the way how it should move with a finite pair of numbers. Almost always z( height ) is fixed, so only x and y are changing.
How can i get a formula/function f(x,y,z) out of this
for example: i give him a vector [x,y]=[(0,0) (0,4) (1,5) .... ]
how do i get this then:
f(x,y,z) = Ax^n +By^m +....
0 个评论
回答(1 个)
Star Strider
2014-5-20
It looks to me that you have a matrix of (x,y) pairs, and that it is actually:
xy = [0 0; 0 4; 1 5];
A = ...
B = ...
n = ...
m = ...
f = @(xy) A.*xy(:,1).^n + B.*xy(:,2).^m + ...
That is how I would do it.
2 个评论
Star Strider
2014-5-20
I have no idea what m and n are. I got the impression that you defined A, B, m and n, and that you wanted to know how to separate the elements of your matrix into x and y values in your function.
If you’re solving for m and n, you must already know the trajectory of the robot. Then this becomes a curve-fitting (parameter estimation) problem.
The illustration you described in your comment is exactly a parameter estimation problem, although in that situation using linear least squares. Yours appears to be a nonlinear system, so probably fminsearch would be the best way for you to determine n and m.
What is it you want to do?
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!