Mask Variables & Mux

12 ビュー (過去 30 日間)
Alberto Carboni
Alberto Carboni 2017 年 2 月 27 日
回答済み: Jose Lara 2017 年 3 月 8 日
Hi all
I have the following problem, I have a block from a library whose mask requires an input parameter.
Such a parameter needs to be different depending on the input.
The problem arises because the input is a muxed signal and I have no idea on how to load a different parameter for each signal present in the mux.
Here is a picture for the sake of clarity:
As requirement I cannot demux the signal going out from CUSTOM BLOCK 1

回答 (1 件)

Jose Lara
Jose Lara 2017 年 3 月 8 日
Hi Alberto,
A MUX block just combines its inputs into a single vector output so basic vector algebra will work. But it really depends on how the Masked Parameter is used in the custom block. If each signal needs is simply exposed addition, subtraction, multiplication, and division, you can simply vector input as a parameter with the same size as the MUX signal. Take the following model below as an example:
The masked block contains only a Gain block with the Parameter "Mult" as the gain.
The input parameter to the masked parameter is a vector as shown below:
Notice the Display block shows that each signal is multiplied by the corresponding multiplier in the masked parameter. This is a simplified version of how you manipulate a MUX signal using a gain. As I mentioned before, it might be more complicated with the custom block but you may try using a vector as an input.

カテゴリ

Help Center および File ExchangeAuthor Block Masks についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by