Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Can i connect Simulink blocks with a structure within the workspace?

1 visualizzazione (ultimi 30 giorni)
I'm trying to organize my parameters in my model. Can i connect Simulink blocks with a given structure in the workspace, so that the block only can get parameters from that structure and not from the whole workspace...
It would be great, if i could say block1 connected witch structure A and if i use parameters in that block, i just need to write b when i mean A.b and the block knows that automatically.
is that somehow possible? thank you for your answers.

Risposte (1)

Azzi Abdelmalek
Azzi Abdelmalek il 17 Mag 2013
  2 Commenti
Fedor
Fedor il 17 Mag 2013
that's not exactly what i've been looking for... this way i can import my input signals in structured form. But i want to have my inner parameters for the blocks in structures. and i dont want them to be inputs...
Fedor
Fedor il 17 Mag 2013
i had an idea but i'm not sure if it works this way. for example i have a structure
sys.part1.a = 10 sys.part1.b = 12 sys.part2.a = 5 sys.part2.b = 1
in simulink i name the file sys.mdl and the two blocks i need are called part1 and part2. i mask both blocks, they have variables a and b. and what i want is that i write a in block part1 and it automatically takes the variable sys.part1.a, same thing with part2. so i thought if the names of the blocks are identical with the substructures i can use those strings to achive what i want.
so i would write something like this in the initialization tag of my blocks: put ['get_param(gcs, 'Name')' '.' 'get_param(gcb, 'Name')'] infront of every constant you get. that's just an idea and i don't know how really to do that. could this work? thanks alot

Questa domanda è chiusa.

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by