Logical operations of multi dimensional matrices
Afficher commentaires plus anciens
Hi,
I am looking for a solution to transform an algorithm with for loop to a faster solution by logical operations.
I have an M(mxmxn) matrix and an n length v vector. So, the M matrix has the same size in the 3rd dimension as the length of the vector. I would like to compare the elements of the M matrix to the value of the vector as follows: M(:,:,i)==v(i)
The output should be an mxmxn size logical.
I know, it is a basic task with a for loop, but I would like to solve it with logical operations to save some computation time.
I would appreciate any suggestion. Thanks.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Matrix Indexing 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!