Hi, i have some data, in excell in 3 columns the first two columns being independant and the third the dependant, or the result.
Im trying to get the data into a look up table to aproxamate the result for any input. im not having much sucess.
Thanks for any help

3 comentarios

Rik
Rik el 14 de Dic. de 2021
The first step is to load the content of the excel file as a variable. Did you do that already?
What do you think the next step is? What did you try?
stephen collier
stephen collier el 14 de Dic. de 2021
yes i can load the data, inported as vectors and into a 2D lookup,
stephen collier
stephen collier el 14 de Dic. de 2021
I also ran it through a surface fit and got the 1*1sfit ans . but i dont know how to use the data

Iniciar sesión para comentar.

 Respuesta aceptada

KSSV
KSSV el 14 de Dic. de 2021
T = readtable('look21 (1).xlsx')
x = T.x ;
y = T.y ;
z = T.z ;
xi = linspace(min(x),max(x)) ;
yi = linspace(min(y),max(y)) ;
[X,Y] = meshgrid(xi,yi) ;
F = scatteredInterpolant(x,y,z,'nearest','none') ;
Z = F(X,Y) ;
surf(X,Y,Z)

3 comentarios

stephen collier
stephen collier el 14 de Dic. de 2021
Thanks KKSV,
I ran that ang got a Fit, how do i use that in a look up table?
KSSV
KSSV el 14 de Dic. de 2021
If you have a point (x,y); Jut use:
z = F(x,y)
stephen collier
stephen collier el 14 de Dic. de 2021
Editada: stephen collier el 14 de Dic. de 2021
I have a 2d lookup table working using the below data, my issue now is when the x or y value is not in it data set the model returns nan, show do you get an interpolated answer? i sorted that by changing the scatterplot as below for any one in the same boat. Thank you KSSV

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2021b

Etiquetas

Preguntada:

el 14 de Dic. de 2021

Editada:

el 14 de Dic. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by