필터 지우기
필터 지우기

Generate a variable sine wave during simulink simulation

조회 수: 11 (최근 30일)
Dani Tormo
Dani Tormo 2013년 1월 14일
댓글: Vaibhav Banajwade 2016년 12월 15일
Hi,
I want to generate a sine which amplitude and delay is changing during a simulation.
From this formula:
out = M * sin(2*pi*50*t + (pi*phi/180)))
I want to change M and phi.
I've tried to generate it using blocks but I am stucked in the sine part. I've tried using a gain but it gives me an error.
The perfect solution for me will be to use the sine wave block and change the variables on the block through an external variable.
Many thanks.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2013년 1월 14일
The Sine Wave block from the Simulink>Sources library does not accept any inputs, so you cannot use this block to change 'M' and 'phi' as you intend. Instead, you should use the MATLAB Function block to implement the same equation while accepting 'M' and 'phi' as inputs to the block.
  댓글 수: 5
Guy Rouleau
Guy Rouleau 2013년 1월 15일
Thanks for sharing the image, that's what I meant. One minor suggestion. You can replace the Product and 1/360 Constant by a Gain block. This will not have significant effects on your small model, but in general the less blocks in a model the better it is. This is especially true on the update time.
Vaibhav Banajwade
Vaibhav Banajwade 2016년 12월 15일
Thank you for the answer. I was also looking for it. But I didn't understand why the "clock" is used.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by