I have a xls file with data regarding simulink blocks. Is it possible to create simulink blocks by running a script that reads the xls file? If yes, where can I find the link to the script?
there are several ways to acchieve this. The simplest would be to write into the preload function of the model (File->Model Properperties-> Callbacks) a call to xlsread reading the data into the workspace. Use those variables in your Simulink blocks.
Hi Titus, Thank you for your answer. I want the blocks to be created automatically in Simulink then may be I can use the method you suggested to set the variables in Simulink blocks. So Is it possible to create the simulink blocks from xls file or xml file?
"automatically" means by some script in MATLAB? Using add_block? Then it would be fairly easy: just set the parameters you want to be changed (e.g. "value" for the constant block or "gain" for the gain block) by the values you read from Excel (note, that you need to convert to a string).