|
I finally found the solution to this problem, however it seems a bit complicated:
My matrix has size N by 3. I wrote 2 functions: return_lower(x, v) and return_higher(x, v).
function result = return_lower(x, v)
result = [];
for index = 1:rows(x)
# if the value in the 3rd vector is bigger then v
if (x(index, 3)>v)
result = [result;x(index, 1:2)];
endif
endfor
endfunction
The second function is very similar.
So, when I have my matrix called M, to show the desired plot I:
1, l = return_lower(M, 50)
2, h = return_higher(M, 100)
3, plot(l(:, 1), (:, 2), ".", h(:, 1), h(:, 2), "x")
Do you know of an easier way to do this? I am asking out curiosity. Thank you.
|