Get error for fit function (surface) in matlab2021

Hello
I have some data I want to use my code but in matlab2021 it does not work. any idea? It could read data but fit does not wok.
clear all
K=readtable('TEMPLDFC.xlsx');
x = K.(1) ;
y = K.(2) ;
z = K.(3);
f = fit([x y],z,"poly23");
Check for incorrect argument data type or missing argument in call to function 'fit'.

3 Kommentare

whos x y z
which fit
Please show us the results of the above
Torkan
Torkan am 7 Apr. 2022
Bearbeitet: Torkan am 7 Apr. 2022
Thanks. Attached
surface fit
consider x y z as a double
x= [1;2;3;4;5]
y=[2;3;4;6;7];
z=[2;6;8;10;34];
These are arbitrary I have my excel file where I read my data
Torkan
Torkan am 7 Apr. 2022

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Walter Roberson
Walter Roberson am 7 Apr. 2022

0 Stimmen

I suspect that you do not have the Curve Fitting Toolbox installed.

1 Kommentar

Torkan
Torkan am 7 Apr. 2022
Hmm. Ok so no problem with the code right? Can I install myself? could you pelase let me know how?

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Get Started with Curve Fitting Toolbox finden Sie in Hilfe-Center und File Exchange

Tags

Gefragt:

am 7 Apr. 2022

Kommentiert:

am 7 Apr. 2022

Community Treasure Hunt

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

Start Hunting!

Translated by