필터 지우기
필터 지우기

How to combine two exponential equations into one?

조회 수: 8 (최근 30일)
parslee
parslee 2022년 3월 2일
답변: KSSV 2022년 3월 2일
I have an increasing exponential function that I need to apply first half of the array and a decreasing exponentail function that needs to be apply to the last half of the array. The increasing exponential function is:
a = 0.879;
b = -0.01986;
y = a*exp(b*x);
and the decreasing exponential funciton is:
a2 = 0.06784;
b2 = 0.01986;
y2 = a2*exp(b2*x);
Is it possible to concatenate this two equations into one?
I'm multiplying these two equations to an array of 128x4224 with the following command:
dataCorrected = bsxfun(@times, dataCorrected, [y y2]);
And I would like y to be multiplied from row 1-2112 and y2 to be multipled from row 2113-4224.

답변 (1개)

KSSV
KSSV 2022년 3월 2일
And I would like y to be multiplied from row 1-2112 and y2 to be multipled from row 2113-4224
Yes, it is possible. Let dataCorrected be your 128*4224 array and y, y2 be 1*2112 vectors.
iwant = dataCorrected.*[y y2] ; % element by element multiplication
Is it possible to concatenate this two equations into one?
IT depends on how you want. And it depends on the values of x.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by