ppval problems with multidimensional spline

I am using csapi to fit a piecewise polynomial to a set of 3d data (2 inputs, 1 response). The code used to create the fit is the following:
---------------------------------
cL_pp = csapi( {aoa, mach}, cL );
---------------------------------
where:
aoa is a 100x1 vector
mach is a 80x1 vector
cL is a 100x80 matrix
Later on in my code, when I try to use cL_pp to predict a new cL value, I get an error. The code and error are below:
---------------------------------
current_cL = ppval( cL_pp, [current_aoa current_mach] );
??? Index exceeds matrix dimensions.
Error in ==> ppval at 67 if lx, [~,index] = histc(xs,[-inf,b(2:l),inf]);
---------------------------------
I have tried several variations to my call to ppval using curly brackets and square brackets; changing the prediction site to be 2x1 instead of 1x2, etc. Trial and error isn't the most efficient way to figure out proper syntax though...
I dug into ppval.m to try to find a solution, and the error looks suspiciously like a coding error in ppval itself, but the indexing used may just be over my head. I am loathe to suggest that I could code better than Matlab :)
Anyone that can point out the error of my ways would be very much appreciated!
p.s. I'm using R2011a

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2012 年 3 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by