specify Simulink block parameters from Excel cells
Mostra commenti meno recenti
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.
Risposta accettata
Più risposte (1)
Mat Nub
il 18 Mar 2014
0 voti
3 Commenti
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
il 18 Mar 2014
Srinivas
il 18 Mar 2014
check the updated script
Categorie
Scopri di più su Data Import from MATLAB in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!