To verify if the "Curve Fitting Toolbox" is installed and recognized by MATLAB, enter the "ver" command in the MATLAB application's command window. The "ver" command will display the version of MATLAB you are using, your license number, and the list of installed toolboxes.
If the "Curve Fitting Toolbox" is not installed, please install it. If it still doesn't work after installation, update the function call by adding “%#function fit”.
The “%#function” pragma in MATLAB is a directive used to inform the MATLAB compiler about functions that are called dynamically (i.e., using “eval”, “feval”, or similar functions). This is particularly useful when deploying MATLAB applications, as it ensures that the specified functions are included in the compiled application.
Additionally, I suggest loading the "census" data using its absolute path.
For more information, refer to the following MathWorks documentation
I hope this will be helpful.