How to output all my Simulink model signals' Output data type?
8 views (last 30 days)
Show older comments
Hi guys, My current project is to findout all the signals' output data type(int16, int32, single, double..). How can I do this? And can i output these information into .CSV file? Thank a lot~
0 Comments
Accepted Answer
Kaustubha Govind
on 1 Dec 2011
You can use the CompiledPortDataType property of block ports to get the port datatype.
outportBlks = find_system('modelname', 'BlockType', 'Outport');
outportDTs = cell(numel(outportBlks), 1);
modelname([],[],[],'compile')
for i = 1:numel(outportBlks)
outportBlk = outportBlks{i};
q=get_param(outportBlk,'PortHandles');
outportDTs{i} = get_param(q.Inport,'CompiledPortDataType');
end
modelname([],[],[],'term');
xlswrite('csvlist.dat',outportDTs);
I used xlswrite because it is the easiest way I could think of to write cell arrays out to a file (although it doesn't separate the strings will commas). You can of course choose one of the several techniques in MATLAB to write the variable outportDTs to a file.
0 Comments
More Answers (0)
See Also
Categories
Find more on String in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!