Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

What is this block?

1 vue (au cours des 30 derniers jours)
Jfp45
Jfp45 le 8 Déc 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
  2 commentaires
Walter Roberson
Walter Roberson le 8 Déc 2016
That appears to be a Heaviside function. Are you asking whether there is a built-in Simulink block to implement it? I do not find it as a single block in Simulink
Jfp45
Jfp45 le 9 Déc 2016
This block is from an old simulink diagram, and is acting as a heaviside, but i cannot find this block, an any built-in block in the library.

Réponses (1)

Prashanth Krishnan
Prashanth Krishnan le 14 Déc 2016
As Walter mentioned, the block in the image represents a heaviside function. Unfortunately, there is currently no block for the 'heaviside' function in Simulink. However, there is a function in MATLAB that implements this, and is called "heaviside". Please refer to the following link for documentation on this function:
  1 commentaire
Walter Roberson
Walter Roberson le 14 Déc 2016
Correct URL should be https://www.mathworks.com/help/symbolic/heaviside.html as the one you gave was for use inside the MuPAD engine.
Either version uses the symbolic engine, which is a problem for Acceleration as nothing in symbolic toolbox can be compiled.
I would therefore suggest using a MATLAB Function Block with
result = double(u >= 0)
or
result = double(u > 0);
or
result = double(u > 0) + double(u == 0) * 1/2;
depending on the behavior that was wanted for 0 exactly.

Cette question est clôturée.

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by