Pourquoi je n'arrive pas à ajouter le block 'Bernoulli Binary Generator' dans mon code matlab ?

Je suis entrain de créer un modèle simulink à partir d'un code matlab.
Lorsque je veux ajouter le block 'Bernoulli Binary Generator' avec ce syntax
add_block('commblk/Bernoulli Binary Generator', [model '/SignalGSM900/Binaire'], 'SamplesPerFrame', '1000', 'Probability', '0.5', 'Position', [50 50 90 80]);
J'obtiens l'erreur suivant :
Error using create_BancMesureGSMR
There is no block named 'commblk/Bernoulli Binary Generator'
Caused by:
Error using create_BancMesureGSMR
Unable to load block diagram 'commblk'
Par contre lorque je fais appel au bloc 'Sum' avec ce syntax
add_block('simulink/Math Operations/Sum', [model '/Sum'], 'Inputs', '++', 'Position', [150 250 180 280]);
Cela marche parfaitement

2 Comments

Hi @Bogus,
Run the following command to add the block in the Simulink model
add_block('commrandsrc3/Bernoulli Binary Generator', 'mymodel/Bernoulli_Block', ...
'SamplesPerFrame', '1000', 'Position', [50 50 90 80]);
Bonjour @Vinay,
Merci cette réponse.
La commande marche parfaitement.

Sign in to comment.

Answers (0)

Products

Release

R2023b

Tags

Asked:

on 17 Jun 2025

Commented:

on 20 Jun 2025

Community Treasure Hunt

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

Start Hunting!