フィルターのクリア

Generate an equation from x,y and z data in a table/surface plot

11 ビュー (過去 30 日間)
Vlatko Milic
Vlatko Milic 2022 年 3 月 24 日
回答済み: VINAYAK LUHA 2023 年 10 月 6 日
Hi,
I wonder if there is any approach to generate a function for values on z based on x and y values, e.g. a X of 1 and a y of 4 corresponds to a z of 10. I know that this will depend on the behaviour of the function but is there a general approach to perform this in Matlab.
How I create the surface plot is according below:
z=Data(2:end,2:end)
z=table2array(z)
x=1:size(z,2)
y=1:size(z,1)
figure(1)
surf(x,y,z)
Thanks in advance.
Kind regards..
  4 件のコメント
Vlatko Milic
Vlatko Milic 2022 年 3 月 25 日
Please see the attached file
Vlatko Milic
Vlatko Milic 2022 年 3 月 25 日
@Akira Agata, I attach the file here. I tried with interp2 but could not make it work. I just want to specify the function for the data

サインインしてコメントする。

回答 (1 件)

VINAYAK LUHA
VINAYAK LUHA 2023 年 10 月 6 日
Hi Vlatko,
It is my understanding that you are looking to create an equation that relates the values of vector "z" to the corresponding values of vector "x" and "y”.
Following are the ways to devise an equation for “z” using “x” and “y” variables:
  • Regression:
If you have a set of data points and want to fit a function to them, you can use regression techniques. Refer to the following documentation for fitting a polynomial function to a set of points-https://www.mathworks.com/help/matlab/ref/polyfit.html
  • Interpolation:
If you have a set of discrete data points (x, y, z), you can use interpolation techniques to generate a continuous function. Refer to the following documentation for interpolating using “interp2” function- https://www.mathworks.com/help/matlab/ref/interp2.html
Hope this helps in devising an equation for “z” using “x” and “y” variables.
Regards,
Vinayak Luha

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by