from curve fit to look up table

조회 수: 1 (최근 30일)
stephen collier
stephen collier 2021년 11월 23일
댓글: Star Strider 2021년 11월 23일
how you you use the answer to a x,y,z curve fit in a look up table?

답변 (1개)

Star Strider
Star Strider 2021년 11월 23일
The question is a bit ambiguous.
Interpolation of some sort would appear to be the best option, and of course the approach depends on whatever the desired result may be.
.
  댓글 수: 2
stephen collier
stephen collier 2021년 11월 23일
when i run the fit i get a 1*1sfit as a ans.
hot do i use the ans in a look up table for any value of x and y ?
Star Strider
Star Strider 2021년 11월 23일
I don’t get anything.
Assuming the arguments are vectors —
x = randn(20,1);
y = randn(20,1);
z = randn(20,1)+2;
xv = linspace(min(x), max(x), numel(x));
yv = linspace(min(y), max(y), numel(y));
[X,Y] = ndgrid(xv,yv);
FSI = scatteredInterpolant(x, y, z);
figure
surf(X, Y, FSI(X,Y), 'FaceAlpha',0.5)
hold on
surf(X, Y, zeros(size(X)), 'EdgeColor','k', 'FaceColor','none')
xq = randn;
yq = randn;
zq = FSI(xq,yq);
coordinates = [xq, yq, FSI(xq,yq)]
coordinates = 1×3
-1.3150 1.1294 1.3476
stem3(xq, yq, FSI(xq,yq), '^r', 'filled', 'MarkerSize',10, 'LineWidth',2)
hold off
grid on
xlabel('X')
ylabel('Y')
This is how I would do it,
.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Curve Fitting Toolbox에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by