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: obstacles_dialog.m
    path of file: ./repos/rrt_toolbox/func
    
    the code of the file until where you have to start completion: function [output, num] = obstacles_dialog(x_constraints, y_constraints)
% OBSTACLE_DIALOG user can draw obstacles here
% this dialog window gets information
% obstacles_dialog(x_constraints, y_constraints)

prompt = {'Number of obstacles'};

    
function [output, num] = obstacles_dialog(x_constraints, y_constraints)
% OBSTACLE_DIALOG user can draw obstacles here
% this dialog window gets information
% obstacles_dialog(x_constraints, y_constraints)

prompt = {'Number of obstacles'};
dlg_title = 'Enter obstacles info';
def = {'3'};
num = str2double(inputdlg(prompt, dlg_title, 1, def));

output = cell(1,num);

for ind_obs = 1: num;
    
    grid on; axis square;
    axis([x_constraints, y_constraints]);
    i = 1;
    points = zeros(100, 2);
    button = 1;
    % until we press middle button of the mouse
    while button ~= 2
        %% obstacle drawing
        hold on;
        for k = 1:ind_obs-1
            fill(output{k}(1:end