Help Making a Certain Waveform

I'm trying to create a waveform that would have an exponential increase followed by an exponential decrease. I am unsure how to manipulate exponential functions in MATLab yet; I'm still learning!
Any help would be terrific.

댓글 수: 1

Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 5일
Can you post your function?

답변 (1개)

Image Analyst
Image Analyst 2013년 1월 5일

0 개 추천

Try this:
x1 = 1:20;
a1 = 10;
b1 = 0.4;
y1 = a1 * exp(b1*x1(1:20));
subplot(3, 1, 1);
plot(x1, y1, 'bs-');
grid on;
% Enlarge figure to full screen.
set(gcf, 'units','normalized','outerposition',[0 0 1 1]);
a2 = y1(20);
b2 = -0.1;
x2 = 21:60;
y2 = a2 * exp(b2 * (x2-20));
subplot(3, 1, 2);
plot(x2, y2, 'bs-');
grid on;
% Combine
x = [x1, x2];
y = [y1, y2];
subplot(3, 1, 3);
plot(x, y, 'bs-');
grid on;
I hope it's not your homework I did for you. Was it?

댓글 수: 2

Sean
Sean 2013년 1월 6일
Haha, no. I've actually been playing with this for a while, but I couldn't really figure it out. I was trying to replicate a continuous waveform of a venous blood vessel, for an idea i had. Thanks for your help. I wasn't able to figure out how to combine the two graphs, and you did that perfectly!
Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 6일
Sean, If the answer satisfies your question, then accept it, by clicking 'accept'

이 질문은 마감되었습니다.

질문:

2013년 1월 5일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by