Logical operations of multi dimensional matrices
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!