find values in a matrix
Afficher commentaires plus anciens
Hi,
I have a matrix A (attached):
A=[0 0 0 0 0 0 0 0 0 0 1933724 260957;
341255 0 0 0 0 0 0 0 0 0 12973 0;
23261 0 0 0 0 0 0 153505 0 420315 0 15372;
0 0 0 0 0 0 0 0 0 5535878 0 0;
0 0 0 0 0 0 0 0 0 16516 0 316637]
the rows of the matrix reppresent trajectories, every cell of the matrix contains the location id of trajectories and the colums indicated the time of study of this trajectories. The time is 24 hours so the rows are divide in interval of 2 hours: total 12 intervals that corrispond to the columns. I hope it's clear. Now I want to find in A, if a location rows is present in a particular interval. Eg. I want to know if 12973 is present in interval 1: if it's present I want to indicate it in another matrix in the same position with the value one, if it's not present I want to extend the interval of research until I can found the value.
Can you help me?
Réponse acceptée
Plus de réponses (1)
Meghan
le 7 Sep 2016
1 vote
You should be able to use the ismember function for that.
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!