simulink &m-file

1 view (last 30 days)
mohamed  al-asklany
mohamed al-asklany on 19 Mar 2012
i have m-file code and a simulink model can i convert m-file code to block in simulink which i can make its input port a sinusoidal signal and its output port frequency of this signal m-file code: {%x input signal and fre output y=fft(x)/fs; y=fftshift(y); y=abs(y); fre=.5*fs+1-find(y==max(y),1);}

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 19 Mar 2012
  6 Comments
mohamed  al-asklany
mohamed al-asklany on 22 Mar 2012
if i use simulation time inf.?
Kaustubha Govind
Kaustubha Govind on 22 Mar 2012
You can use any simulation time, that doesn't affect the operation of the block - the model will just keep running until you stop it.

Sign in to comment.

More Answers (0)

Categories

Find more on Programmatic Model Editing in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!