I'm looking for an a command or trick to convert two arrays to a sparse matrix. The two arrays contain x-values and y-values, which gives a coordinate in the cartesian coordinate system. I want to group the coordinates, which if the value is between some value on the x-axes and the y-axes.
% MATLAB
x_i = find(x > 0.1 & x < 0.9);
y_i = find(y > 0.4 & y < 0.8);
%Then I want to find indicies which are located in both x_i and y_i
Is there an easy way to this little trick?