Borrar filtros
Borrar filtros

errors in matlab function block in simulink

1 visualización (últimos 30 días)
mohamed samhy
mohamed samhy el 11 de Abr. de 2016
Editada: mohamed samhy el 15 de Abr. de 2016
i am trying to create a matlab function block in the Simulink that generates square pulses as pulse generator but errors appear please help , I attached screenshots.
<<
>>

Respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 11 de Abr. de 2016
Your code is not correct. Plus, generating a puls train with Matlab function is not a good idea. You have to know that your Matlab function block, the way it's programmed, will outpu,t each sample time, an entire array.
You can generate such signal with from file block, from worksapce block or using repeated sequence
If you want to use from file block
Fs=1e+9
tend=10*4e-6
t=0:1/Fs:tend;
pulsewidth=1e-6
pulseperiods=(0:10)*4e-6
x=pulstran(t,pulseperiods,'rectpuls',pulsewidth)
v=[t;x];
save yourfile v
Then set the name "yourfile" in the frome file block
  28 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 12 de Abr. de 2016
Here a simulink model
mohamed samhy
mohamed samhy el 15 de Abr. de 2016
Editada: mohamed samhy el 15 de Abr. de 2016
it did work ,man you are such a great helpful person hope u have a happy life for helping people so much . thanks again man :)

Iniciar sesión para comentar.

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by