close all; clear; clc

% locations of several coffee shops in blocks
x = [ 1  2  3 -2 -3 -3 -4 -5 -6 -4 -4];
y = [-1 -1 -1 -1 -1 -2  0 -1 -1  4  5];

% calculate distance to the coffee shops
dist = sqrt(x.^2 + y.^2);

% are they closer than 3.5 blocks?
closer = dist < 3.5

% which are not closer than 3.5 blocks?
~closer

% which have pasteries
pasteries = [0 0 1 0 1 0 0 1 1 0 1];

% which coffee shops have pasteries and are closer than 3.5 blocks
closer & pasteries

% coffee shops that are closer than 3.5 blocks or have pasteries
closer | pasteries