필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

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

조회 수: 1 (최근 30일)
Fedor
Fedor 2013년 5월 17일
마감: MATLAB Answer Bot 2021년 8월 20일
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.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 17일
  댓글 수: 2
Fedor
Fedor 2013년 5월 17일
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 2013년 5월 17일
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

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by