Hi,
Try moving to a directory whose path does not have a 'space' character.
It is best practice to avoid using spaces or any special characters in folder names used by MATLAB and Simulink. A space is present in your current path:
C:\Program Files\MATLAB\R2018b\bin\win64\sm_robot_DataFile.m'.
You may also try renaming the sm_robot_DataFile.m to smrobotDataFile.m to eliminate the occurence of underscore character "_" in the MAT file name.
Having changed the directory, make sure to run this command:
>> addpath <new path (before the .m file)>
Another approach you may try is to navigate to the model's Model Workspace in the Model Explorer in the generated model. Change the Workspace Data Source from MATLAB File to MATLAB Code. Copy the contents of the generated "sm_robot_DataFile.m" and paste it into the text area. Click Apply.
DISCLAIMER: These are my own views and in no way depict those of MathWorks.
Best Answer