MATLAB Answers

To Workspace doesn't accept "a.b" ?

1 view (last 30 days)
Zaki on 21 Aug 2014
Commented: Zaki on 25 Aug 2014
Hello guys,
"To Workspace" doesn't accept structure e.g. "a.b" within its "Variable Name" field.
Is there a way around this?
My aim is to have a subsystem with a Masked Parameter "Name" = main_name
and within the subsystem is a "To Workspace" block with its "Variable Name" field = main_name.something
How can I make this happen?
Thank you.
I am using R2009b.


Sign in to comment.

Answers (1)

Yu Jiang
Yu Jiang on 22 Aug 2014
Hi Zaki
You may want to consider using a bus to generate a structure and pass that to a variable in To Workspace.
For more information regarding bus, see
I have also attached a simple example, you may want to take a look. Hope it helps!
- Yu Jiang

  1 Comment

Zaki on 25 Aug 2014
Hello Yu Jiang,
Thanks for replying. That method you've just showed did not retain their signal names. I would have preferred to see myvar.a and myvar.b within my workspace. I've also created an unelegant S-function solution here where I can write to a structure in the workspace directly. I'm still looking for an elegant solution though.

Sign in to comment.

Translated by