フィルターのクリア

error with interpn function "Grid arrays must have NDGRID structure"

29 ビュー (過去 30 日間)
RR
RR 2022 年 2 月 2 日
コメント済み: Walter Roberson 2022 年 2 月 2 日
Dear all,
I have two matrix a=10x2 and b= 10x2. they are the indipendent variables of an unknown function C(a,b)= 10x3. I would like to evaluate this function in Aq (100x2) and Bq (100x2) variable.
a % 10x2 matrix
b % 10x2 matrix
C % 10x3 matrix
% difine Aq 100x2 and Bq 100x2
a1=[min(a(:,1)):1:max(a(:,1))]';
a2=[min(a(:,2)):1:max(a(:,2))]';
Aq(:,1)=a1(1:100);
Aq(:,2)=a2(1:100);
b1=[min(b(:,1)):1:max(b(:,1))]';
b2=[min(b(:,2)):1:max(b(:,2))]';
Bq(:,1)=b1(1:100);
Bq(:,2)=b2(1:100);
%interp function C at Aq and Bq;
Cq = interpn(a,b,C,Aq,Bq)
I have this error
"Error using griddedInterpolant
Grid arrays must have NDGRID structure.
Error in interpn (line 151)
F = griddedInterpolant(X{:}, V, method,extrap);"
Why? what is wrong in my code?
thank you very much in advance
RR
  13 件のコメント
RR
RR 2022 年 2 月 2 日
Unfortunately griddatan outputs vq with is a vector of length p (p= number observation) while I would like to obtain instead a matrix of size px3.
Walter Roberson
Walter Roberson 2022 年 2 月 2 日
Do three separate griddatan(), one for each column of C.

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

回答 (0 件)

カテゴリ

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