MATLAB: Find_system truncate with … and mess up listdlg index

find_system listdlg triple dotMATLAB

Hello,
I used find_system to list my simulink blocks, it has a long path and I got this:
'/Signalbus IN'
'/Controllerbus IN'
'/Bus…'
'/Bus…'
'/Bus…'
'/Bus…'
'/BusConnection'
'/Subsystem'
now when I put them on listdlg, the 'Bus…' take 2 lines like
/Signalbus IN
/Controllerbus IN
/Bus
Creator1
/Bus
Creator2
/Bus
Creator3
/Bus
Creator4
/BusConnection
/Subsystem
and it messes up the index.
I want it just to display its full name, that is Bus Creator 1, Bus Creator 2, etc. and not taking 2. so when I choose it on listdlg, it gives me the correct index.
thank you for your help

Best Answer

This is because the default Simulink block name contains a carriage return or char(10) for "Bus Creator" block. You can see it when you show the "Bus Creator" block in Simulink.
You can process the cell string using NewPaths=strrep(BlockPaths,char(10),' ') to remove it and then they will show in one line in listdlg. However, keep the original BlockPaths because you will need to index it and track back to the blocks in the Simulink model.