# How to find value closest to set value after a certain index in a matrix

6 visualizaciones (últimos 30 días)
Heidi Peussa el 18 de Jun. de 2021
Comentada: SALAH ALRABEEI el 18 de Jun. de 2021
Hi,
I have time lapse data of intensities. There is first 10 rows of baseline and then stimulation, after which the intensity values peak. Aftert peaking the intensities begin to derease; sometimes they drop back to baseline but usually they remain elevated. There are varying amounts of columns but each column has 131 rows. Each column represents data from a single cell, and ear row is a different timepoint.
For each column I would want to find the max value (peak of the signal) and its index. Additionally I would like to know how long it takes for the signal to drop to 1/2 max value, or the value closest to that.
I am able to find the max value and its index, but hen it gets tricky.
[M,Im] = max(x);
% M is max value in each column and Im is the index of each max value
The biggest problem is how to make the code search for 1/2 max value ONLY in the rows after the max value.
##### 0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

### Respuestas (1)

SALAH ALRABEEI el 18 de Jun. de 2021
[N,IN] = min(abs(M/2-x)
##### 2 comentariosMostrar NingunoOcultar Ninguno
Heidi Peussa el 18 de Jun. de 2021
Thanks Salah! It almost works. The problem is that now it finds the 1/2 max value from before the peak, from the baseline part of the data. I would need it to exclude all hits prior to the Im index and only take into account data after the max value.
SALAH ALRABEEI el 18 de Jun. de 2021
[N,IN] = min(abs(M/2-x(IM:end));
IN = IN + IM -1;

Iniciar sesión para comentar.

### Categorías

Más información sobre Descriptive Statistics en Help Center y File Exchange.

### Community Treasure Hunt

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

Start Hunting!

Translated by