How to combine two exponential equations into one?

7 views (last 30 days)
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.

Answers (1)

KSSV
KSSV on 2 Mar 2022
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.

Categories

Find more on Creating and Concatenating Matrices 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!