MATLAB: How to use the “scatteredInterpolant” function object which is present in MATLAB workspace inside Simulink Model

blockfunctioninterpretedMATLABscatteredinterpolantsimulink

How to use the "scatteredInterpolant" function object, which is present in MATLAB workspace inside Simulink Model?

Best Answer

There is a block called 'Interpreted MATLAB Function' block, which can be helpful in your scenario. Following documentation link provides information on the block:
I have attached an example model 'scatterInterpolantObjRead.slx' (which uses the 'scatteredInterpolant' object created in MATLAB workspace) and MATLAB script 'scatterInterpolantObj.m' (which creates the 'scatteredInterpolant' object). Please execute the attached files in the following order:
  1. Execute the 'scatterInterpolantObj.m' file
  2. Run the Simulink model 'scatterInterpolantObjRead.slx'
The attached example demonstrates how to use the 'scatteredinterpolant' object in the MATLAB workspace in Simulink Model.