function [row,col] = LEM_row_col(cells,pt)
% LEM_row_col - find row,col for point in cells
% On input:
%     cells (cells struct): cells info
%     pt (1x3 vector): 3D point
% On Output:
%     row (int): row in cells for pt
%     col (int): col in cells for pt
% Call:
%     [r,c] = LEM_row_col(cells,pt);
% Author:
%     T. Henderson
%     UU
%     Fall 2020
%

x_vals = [cells.x_min:cells.del_x:cells.x_max];
if x_vals(end)~=cells.x_max
    x_vals(end+1) = cells.x_max;
end
y_vals = [cells.y_min:cells.del_y:cells.y_max];
if y_vals(end)~=cells.y_max
    y_vals(end+1) = cells.y_max;
end

x_less = find(x_vals<=pt(1));
y_less = find(y_vals>=pt(2));
row = max(1,length(y_less));
col = max(1,length(x_less));
