function instead of grid data without Interpolation

3 ビュー (過去 30 日間)
Mah Mhata
Mah Mhata 2019 年 2 月 3 日
コメント済み: Mah Mhata 2019 年 2 月 4 日
I want to make Matrix with 3 vector. but griddata make wrong result, does any one know the other function for making matrix?
  2 件のコメント
madhan ravi
madhan ravi 2019 年 2 月 3 日
編集済み: madhan ravi 2019 年 2 月 3 日
Could you upload the code so that the pattern is observed and an alternative solution can be given?
Mah Mhata
Mah Mhata 2019 年 2 月 3 日
clear all
close all
clc
x=[1,8,2,8];
y=[2,3,0,9];
z=[80,30,30,40];
[X,Y]=meshgrid(x,y)
Z=griddata(x,y,z,X,Y)
u=trapz(x,Z,2)
I=trapz(y,u)

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

回答 (1 件)

KSSV
KSSV 2019 年 2 月 4 日
x=[1,8,2,8];
y=[2,3,0,9];
z=[80,30,30,40];
[X,Y]=meshgrid(x,y) ;
F = scatteredInterpolant(x',y',z') ;
Z = F(X,Y) ;
u=trapz(x,Z,2)
I=trapz(y,u)
  4 件のコメント
madhan ravi
madhan ravi 2019 年 2 月 4 日
編集済み: madhan ravi 2019 年 2 月 4 日
It was confusing because OP mentioned "function instead of grid data without Interpolation" so I thought there is some function which doesn't interpolate data similar to griddata() or scatteredInterpolant()?
Mah Mhata
Mah Mhata 2019 年 2 月 4 日
Z =
80.0000 25.0771 70.0000 25.0771
91.7930 30.0000 74.2857 30.0000
40.5238 8.7696 30.0000 8.7696
129.8353 40.0000 112.3279 40.0000
It has interpolation too.It is not right answer for calculating the area under this curve.
what should I do?I think my data is in 3d model, please help me how I can calculate the area under the curve or surface

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

カテゴリ

Help Center および File ExchangeInterpolation についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by