returning values of a matrix between two values
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi Matlab Experts,
I've got a basic question.
If I've created a matrix:
data_bounds = [event_samples(1),event_samples(end)]; % let's say its value is [79502,5316744]
In my case, this data_bounds variable corresponds to column numbers in another matrix (say it is called "data"). How do I pull the columns from data between the values of data_bounds?
Thanks!
PK
0 comentarios
Respuestas (2)
Aquatris
el 23 de Ag. de 2018
desiredData = data(:,event_samples(1):event_samples(end))
0 comentarios
PAK
el 23 de Ag. de 2018
2 comentarios
Aquatris
el 23 de Ag. de 2018
That means the "data" variable does not have 5272240 elements in it, which means you are calculating the bounds wrong.
Or you actually store data as row, in which case you should use
desiredData = data(event_samples(1):event_samples(end),:)
What is the size of your data variable?
Ver también
Categorías
Más información sobre Matrix Indexing 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!