Hello,
In the latest version of SAM, you can use the code generator to create a MATLAB script that assigns values to input variables based on the data in your SAM project. For example, you would create your CSP system in SAM, and then on the Case menu, click Generate Code, and choose MATLAB. SAM will then create the files you need to access the SAM API from MATLAB.
Best regards,
Paul.