Problem with interp3 - "Interpolation requires at least two sample points for each grid dimension."
1 次查看(过去 30 天)
显示 更早的评论
I am trying use the interp3 function to interpolate between x3 variables; Angle of Attack, Reynolds number, & flap angle. These are contained within a excel spreadsheet. The code is used to find the coefficient of performance of a wind turbine at different tip-speed-ratios. The main body of the code works fine & I've used it before without the interp3. I have also used interp1 before & in a similar way without issues.
CL=interp3(DATA(:,1),DATA(:,2),DATA(:,3),DATA(:,5),AOA,flap_Angle,Re);
CD=interp3(DATA(:,1),DATA(:,2),DATA(:,3),DATA(:,6),AOA,flap_Angle,Re);
I get the error message "Interpolation requires at least two sample points for each grid dimension."
I confused by this because the data I'm feeding in does have x2 points for Reynolds number & multiple for Flap angle & Angle of attack. So I'm not sure where I am going wrong.
Hopefully it's not something obvious I've missed! Any help would be grately appreciated.
Thank you, in advance, for your time.
0 个评论
回答(1 个)
Ayush Modi
2023-10-9
Hi Joe,
As per my understanding, you would like to interpolate values of a function of three variables at specific query points using linear interpolation.
From ‘interp3’ MathWorks documentation, it is known that if X, Y, and Z are grid vectors, then:
size(V) = [length(Y) length(X) length(Z)]
If the size of V in the provided code does not conform to this requirement, it will result in an error.
Please refer to the following documentation to know more about ‘interp3’ function:
I hope this resolves the issue you were facing.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!