Info

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

Is it possible to inherit units for port in a for each subsystem?

조회 수: 2 (최근 30일)
Chris Dyer
Chris Dyer 2017년 4월 6일
마감: MATLAB Answer Bot 2021년 8월 20일
I have a vector of signals with a unit specification of km/h that are routed to a for each subsystem on a partitioned port.
Inside the for each subsystem I have a unit conversion block to convert from km/h to m/s for a port that has a m/s unit specification
Simulating this results in an error
Caused by:
Unable to convert between '' and 'm/s' because an empty unit ('') indicates that the unit is unspecified. Consider using a Signal Specification block to specify a unit.
When I enable display units on signals, Simulink displays the correct signal unit both inside and outside the for each subsystem, but it does not seem to evaluate correctly.
If I do not partition the signal, the units are propagated correctly.
Is there a way to have the units propagated automatically for a partitioned signal, or do I need to specify the unit type on the input port?
Using Matlab 2017a
Cheers, Chris
  댓글 수: 2
Rollin Baker
Rollin Baker 2017년 4월 13일
Hi Chris,
What do you mean by a "partitioned" signal? Would it be possible to share screenshots of both scenarios?
Chris Dyer
Chris Dyer 2017년 4월 18일
Hi Rollin, by "partitioned" I mean, a signal that has had the checkbox for "Partition" enabled in the ForEach block, within the For Each Subsystem.
I have some screenshots from a simple example.
The Top Level which specifies units on a vector signal and a scalar signal.
And the For Each level which specifies a different unit on each signal.
Note that the first input does not have "Partition" enabled in the ForEach block parameters, and the second input does (shown by the different inport display).
The first signal has the units converted correctly, while the second input throws the error on simulation (as per the question above except it would be '' and km/h as I used the opposite unit conversion in the example).
Note that both signals show the correct units when the display option for port units is enabled.

답변 (0개)

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

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by