0
votes

I'm trying to load what equates to a configuration file of csv format into my matlab work space. I have numerous variables that are essentially hard coded. To help the end user I want to import these variables from an excel file so that should any of them change the end user only needs to edit the excel file and doesn't need to worry about anything going on under the hood. From there simulink can grab the variables it needs from the workspace.

Short of using the "eval" function in matlab i havent figured out a way to do this. I'm extremely hesitant to use eval for all of the standard reasons. Any suggestions? I can't find any good documentation on this even though this seems like a relatively standard request.

1

1 Answers

0
votes

I just thought of a rather roundabout solution. I can make a function to read an excel file and forcefully create a variable.m file where everything in it is just a variable declaration statement. Then i can call that in my main build file to load it into the workspace. I can work in some regex to make sure the variable names are standard enough.