Still works on R2013a A few notes for those who are trying this- if you have other commands that have altered startup.m (like ezyfit) you have to seek those out and ensure that you have merged the startup.m files to accomplish all the startup tasks required (for instance, ezyfit, as well as the preserve_history functions).
I found my altered startup.m file in my "userpath" - try that on the command line to see what yours is. Matlab suggests using this path for startup.m as well as other user mfiles necessary for your work for easy path inclusion.
Note that any other startup.m files that are higher up in the path (in the path dialog in matlab) will be executed first, and all subsequent startup.m files will be ignored.
Utilizing these files and matlab's own startupsav.m file (located in toolbox/local) I now have a program that launches from where I left off before and pre-loads any variables that I was working with from a default matlab.mat file in the directory that I was working in previously.
I love it! Thanks!!
Hello thank you for the reply. I have finally got it working with much success. I'm still not sure where the "inlined" error came from but now it's gone.
I have a question for you. I'm trying to use global variables throughout the simulink model. It works if I call the variable within the same s-function as your guide said. However, if I call that variable in another S-function it gives me an error " error: <variable> undeclared (first use in this function)" pertaining to the wrapper file. I find this strange since all my calls to functions within the "#includes" headers work.
For example, my includes section looks as shown below:
# ifndef MATLAB_MEX_FILE
int uart0_filestream = -1;
I can call all functions within the first 3 headers, however, if I call uart0_filestream in another block I get the error.
I have not been able to get this to work at all. I'm using MATLAB 2013a Student version. I generate C code using the steps provided. However, when I try to download it to the Arduino, it gives me an error that the function is not in-lined and therefore cannot be downloaded to the target. It tells me to go into the configurations->Simulink Coder and turn in-lining off but since I'm using the student version I don't see this option. Has anyone gotten this error before? I see no where in the documentation