specify Simulink block parameters from Excel cells
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (1)
Mat Nub
el 18 de Mzo. de 2014
0 votos
3 comentarios
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
el 18 de Mzo. de 2014
Srinivas
el 18 de Mzo. de 2014
check the updated script
Categorías
Más información sobre Data Import from MATLAB en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!