Azzera filtri
Azzera filtri

How to create and rename a bus?

3 visualizzazioni (ultimi 30 giorni)
geieraffe
geieraffe il 13 Lug 2016
My actual question is: How can I assign a (new) name to a variable, whose name I do not know explicitly?
But maybe some one has a much nicer way for the complete thing I want to do:
- I have a nested struct
- I want to create a bus structure from it
- I want this bus to have a specific name
For now, this is my way to do this:
myStruct = struct();
myStruct.a.aa = 1;
myStruct.a.ab = 2;
myStrcht.b.ba = 3;
myStruct.c.ca = 4;
busInfo = Simulink.Bus.createObject(myStruct);
myBus = eval(busInfo.busName);
Is there a way to avoid eval()?
Or is there a way to specify, how the bus should be named in busInfo (mybe even the sub busses)?

Risposte (0)

Categorie

Scopri di più su Simulink Functions in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by