How to create a semicircular pulse function?

조회 수: 6 (최근 30일)
Matheus Angelo
Matheus Angelo 2018년 12월 2일
댓글: Image Analyst 2018년 12월 4일
I need to write a function that adds a rectangularPulse, a triangularPulse and a semicircular pulse, but i can't find a way to do this. All the answers I find here plots directly the semicircle, but it doesn't create a function that i can add to others and it isn't a pulse.
Basically, what I'm trying to do is:
syms x
p = 4*rectangularPulse(-4,4,x);
a = (-pi)*triangularPulse(0,2,x);
c = (-1)*semicircularPulse(-4,0,x); %% where -4 is the rising edge of the pulse, 0 is the falling edge and the radius is 2. (|-4+0|/2)
fun = p + a + c;
fplot(fun, [-5 5])
But I still couldn't figure how I'm going to do this semicircularPulse function.
Thank you.

답변 (1개)

Image Analyst
Image Analyst 2018년 12월 2일
Have you seen the FAQ: How to create an arc? I bet you can figure it out from there.
  댓글 수: 4
Matheus Angelo
Matheus Angelo 2018년 12월 4일
I did exactly that, but I need to transform the semicircular in a pulse, like the rectangular pulse and the triangular pulse. Basically, I need a function that gives me 0 outside the semicircle, just like this but with a semicircle.TriangularPulseFunctionPlotTheTriangularPulseFunctionExample_01.png
Image Analyst
Image Analyst 2018년 12월 4일
I don't have the Symbolic toolbox so all I can do is to do it numerically.
Basically just make a function that ignores the signal and makes an array that is all zero except it's 1 at x=0. Or make two ramps if there are lots of x values.
But your first question didn't seem to say that you wanted to transform the circle into a triangle. It seemed to say you need to create three differently shaped signals and simply add them together. So which is it?
  1. Create three signals and add together, or
  2. Make a transform that makes any signal into that triangle?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by