Simulink IDDATA Sink block does not work properly
Mostrar comentarios más antiguos
Hi,
It does not set the name or units of the input signals when generating the iddata structure for identification. We have to set them manually in the matlab workspace. Is there any way they are already exported by the block, or will this still be an unresolved simulink bug in version R2020a yet? Thank you.


I have to add manually the units and name

Respuestas (1)
It took a while, but I saw your post here and added this functionality as an enhancement in 26b.
mdl = getfullname(new_system());
u = add_block("simulink/Ports & Subsystems/In1",mdl+"/Input Data",Unit="N");
y = add_block("simulink/Ports & Subsystems/In1",mdl+"/Output Data",Unit="m",PortDimensions="2");
sink = add_block("slident/Iddata Sink",mdl+"/Iddata Sink");
Simulink.connectBlocks(u,sink);
Simulink.connectBlocks(y,sink);
p = get_param(u, 'PortHandles');
set_param(p.Outport, 'Name', 'uName');
p = get_param(y, 'PortHandles');
set_param(p.Outport, 'Name', 'yName')
in = Simulink.SimulationInput(mdl);
out = sim(in);
disp(out.data.InputUnit)
disp(out.data.InputName)
disp(out.data.OutputUnit)
disp(out.data.OutputName)
Categorías
Más información sobre Transform Data en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!