How can I access signals logged from Simulink which contains spaces in their name?

Illustration
Armani_78 - 2020-09-18T10:54:33+00:00
Question: How can I access signals logged from Simulink which contains spaces in their name?

When I log Signals in Simulink, I obtain a structure named 'logsout'. If the signal is a bus which contains signals with space in their name I can not access it from the workspace. When I log a Bus signal, I try to access its values in the MATLAB workspace by using the following command: logsout.VeryBig.Big Bus I receive the following error message: ??? logsout.VeryBig.Big Bus Error: Unexpected MATLAB expression. I would like to know a way to access this signal.

Expert Answer

Profile picture of Kshitij Singh Kshitij Singh answered . 2025-11-20

To access logged data that have spaces in their names, use the following syntax:

logsout.VeryBig.('Big Bus')

If the Bus signal contains many levels of signals, the following error is generated:

logsout.VeryBig.('Big Bus').('bus with space')
 ??? Error using ==> subsref

 Invalid field name component.

To workaround this issue, please assign the subfield to a new variable as in the following example:

B=logsout.VeryBig.('Big Bus')

B.('bus with space')


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!