Borrar filtros
Borrar filtros

How to combine two exponential equations into one?

8 visualizaciones (últimos 30 días)
parslee
parslee el 2 de Mzo. de 2022
Respondida: KSSV el 2 de Mzo. de 2022
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.

Respuestas (1)

KSSV
KSSV el 2 de Mzo. de 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.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by