I have a matrix of 1's and 0'1, m2. I have another matrix with the same dimensions as m2, containing values (i.e., m1). Of these values, I am only interested in those where the corresponding value in m2 is 1. However, as an extra condition, I wish to create m3, which has the same dimensions as m1 and m2, and contains the selected values in the corresponding places, with all other places being NaN. I am stuck on how to do that without looping.
MATLAB: M1(m2 == 1), but with dimensions of m1 intact
indexing
Related Question
- How to get a number in matlab
- What does M([1:1 2:3], [1:0 2:3]) mean
- Hello,can anyone help me completeing this program? in the program i have an equation in laplace domain, in which i have symbolic constants and variables. i’am willing to find its inverse laplace without assigning any value to the symbolic constants
- Reshaping (M,N)-matrix to (M,1)-matrix
Best Answer