Getting Simulink compile-time error "Grid inputs must be vectors or the output of MESHGRID" even though I don't get that error when I try testing those lines in MATLAB
2 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone. I have a table of aerodynamic coefficients and I'm trying to interpolate within them and do a spline extrapolation outside of them. I am passing in the Mach number and Angle of attack to a MATLAB function block, and I'm passing that through interpn in the following way:
aero.Cmdh = interpn(params.aero.Cmdh.X, params.aero.Cmdh.Y, params.aero.Cmdh.V, Mach, alpha, "spline");
When I do this, I get the following error at compile-time:
I'm assuming it's during compile-time because any breakpoints I put within the function are not triggered. However, when I open up an empty MATLAB file and run the line of code provided above, I don't get any errors, and get a reasonable output. Why is it that I don't get any errors in MATLAB but get errors in Simulink? How do I fix this issue? Any kind of insight would be greatly appreciated.
0 件のコメント
回答 (1 件)
Paul
2022 年 10 月 24 日
That's an odd error message insofar as interpn actually requires the the grid inputs to be the output of NDGRID (not MESHGRID) accordig to interpn.
Regardless of the error message, how is the params struct being passed inot the Matlab Function block?
How are the fields params.aero.Cmdh.* created?
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!