resistor with random variable number not working

Hello i have many simulink blocksets,
i have tried to put rf blockset in order to build a ressistor with random value in it as shonn bellow.
but its not working .Where did i go wrong?

 采纳的回答

There is no need to add randn(1) in the resistor value. As the documentation page mentions: https://www.mathworks.com/help/simrf/ref/variableresistor.html you just need to tick the "Simulate noise" checkbox. In the resistance field, just type 50. Also, make sure that the "simulate noise" box is ticked in RF-blockset configuration block.

8 个评论

Hello Ameer , in the following manual i have found Tollerance option.
is there a way to have such "tollerance" option to a voltage source?(so i will have a small random option to a DC source) i need 255 such sources for 8bit flash adc.
Which voltage source are you referring to? For example, this voltage source has the option to enable noise: https://www.mathworks.com/help/releases/R2020a/physmod/sps/ref/voltagesource.html
Hello Ameer, i am looking for avoltage source with a little offset (set randomly aroundsome DC value) exactly like the tollerance option in the resistor..
It would be great if you could recomment me such a component.
Thanks.
The voltage source suggested in my last comment does that. You can specify the power of the noise signal and it will add that noise to nominal DC value.
Hello Amer that the problem i hace a DC source for example 1V
i want it to vary by 0.1V so you say i should add 0.01 V^2/Hz in the noise to represent it?
Thanks
It seems correct, but I am not entirely sure. You may need to do some experiments by connecting this block with the scope and observing the variation in voltage value.
another thing is that this voltage source is connected into an opamp where i have defined in the opamp some input noise.
Will the noise from the voltage source and input noise of the opamp will be in a conflict by MATLAB behavior? how they will play together?
Thanks.
It is difficult to predict. You will need to run the model to check if it works.

请先登录,再进行评论。

更多回答(0 个)

类别

Community Treasure Hunt

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

Start Hunting!

Translated by