specify Simulink block parameters from Excel cells
Show older comments
I have a Simulink model containing over 300 unit delay blocks. So manually entering sample times is arduous process (copy/paste does not help as sample time differ from block to block). Is there any way for blocks to call sample times from a xls spreadsheet? If not directly from xls could this be done at least from Matlab workspace?
My thinking is to map the blocks in the model as cells in xls and then whatever changes happen in xls model will pickup and put in appropriate block.
Accepted Answer
More Answers (1)
Mat Nub
on 18 Mar 2014
0 votes
3 Comments
Supposing you have an excel sheet like this with two columns
a 1; b 2; c 3
[num,text] = xlsread('Book1.xlsx');
for ind = 1 : numel(num)
assignin('base',text{ind},num(ind))
end
this script will declare them in the base work space. HTH
Mat Nub
on 18 Mar 2014
Srinivas
on 18 Mar 2014
check the updated script
Categories
Find more on Data Import from MATLAB in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!