function [panels] = plategen(nx, ny)
% Generates discretization of a 1x1 plate in the xy plane with nx*ny panels
panels = zeros(5,3,nx*ny);
dx = 1/nx;
dy = 1/ny;
p_index = 1;
for i = 1:nx
    for j = 1:ny
        panels(1,1,p_index) = 4; % Num vertices (4=quads)
        panels(1,2,p_index) = 1; % Conductor number, 1
        panels(2,:,p_index) = [(i-1)*dx, (j-1)*dy, 0];
        panels(3,:,p_index) = [i*dx, (j-1)*dy, 0];
        panels(4,:,p_index) = [i*dx, j*dy, 0];
        panels(5,:,p_index) = [(i-1)*dx, j*dy, 0];
        p_index = p_index + 1;
    end
end

