0

So in one of the mask in the model i came across an initialization command that i don't understand.

The logic is for an SR Flip Flop. That latches the output. It has 1 parameter that takes in the initial state for output 1(Output is o and o(bar)). Which has the following properties:

Name: MaskParam1
Value: 0
Type: Edit
Evaluate: True
Tunable: True

The command is written in the Initialization tab of the Mask Editor.

ini = (@1~=0);

The first thing that came to my mind was anonymous function handle, that returns value of the parameter. In this case would be 0. So as

(0 ~=0) = 0
hence the initial output of SR will be 0.

When i type the following in matlab:

ini = (@1~=0);

I get an error of unexpected matlab expression.

So I tried another thing. Considering as the Parameter is refering to the masked parameter so if we take a variable:

x = 0;
% The default value for the mask parameter
ini = (@x~=0);

This will give an error that

Error: "x" was previously used as a variable, conflicting with its use here as the name of a function or command.

So my question is ini

ini = (@1~=0)

a function or a variable??enter code here

Siddharth Kaul
  • 544
  • 5
  • 17
  • @1 is not a valid MATLAB syntax. Those are likely replaced with some variable before evaluation. You should be able to use the mark variables directly instead of referencing them using @ symbols. – Navan Apr 09 '18 at 20:19
  • As @Navan has indicated, the `@1` is a token that gets replaced. I'd assume it's for the first parameter in the mask. – Phil Goddard Apr 09 '18 at 22:07
  • Yup. you guys are right. This was indeed a reference to the mask parameters. @1 means the first parameter. But i tried doing it got an error The reference to the symbol of type @n or &n are not allowed in the mask initialization and to use the Mask Parameter Name for it. So probably in some older version of matlab this was supported. Now it is no longer supported. – Siddharth Kaul Apr 13 '18 at 14:51

0 Answers0