Simulink IDDATA Sink block does not work properly

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)

Andrew Ouellette
Andrew Ouellette el 19 de Oct. de 2026 a las 21:13
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)
{'N'}
disp(out.data.InputName)
{'uName'}
disp(out.data.OutputUnit)
{'m'} {'m'}
disp(out.data.OutputName)
{'yName(1)'} {'yName(2)'}

Productos

Versión

R2020a

Preguntada:

el 20 de Jun. de 2020

Respondida:

el 19 de Oct. de 2026 a las 21:13

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by