You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: rect2mask.m
    path of file: ./repos/3D-scanner/examples/plane_8lines/scripts
    
    the code of the file until where you have to start completion: function [mask1] =  rect2mask(img_num,img_name,y_max,output_file_name)
% 合成read_images.m和make_mask_new.m
% 读取image_rect图片，做mask点乘后保存至img_mask.mat
mask = zeros(1024,1280);

    
function [mask1] =  rect2mask(img_num,img_name,y_max,output_file_name)
% 合成read_images.m和make_mask_new.m
% 读取image_rect图片，做mask点乘后保存至img_mask.mat
mask = zeros(1024,1280);
for i = 1:y_max
    for j = 1:1280
        mask(i,j)=1;
    end