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: make_dendritic_video.m
    path of file: ./repos/CaImAn-MATLAB/utilities
    
    the code of the file until where you have to start completion: function make_dendritic_video(A,C,b,f,Y,d1,d2,param)

% use that to make movies for dendritic/axonal imaging data

if nargin < 8
    param = [];
end


    
function make_dendritic_video(A,C,b,f,Y,d1,d2,param)

% use that to make movies for dendritic/axonal imaging data

if nargin < 8
    param = [];
end

if isfield(param,'ind');  % indeces of components to be shown
    ind = param.ind;
else
    ind = 1:7;       
end

if isfield(param,'skip_frame'); % skip frames when showing the video
    skp = param.skip_frame;
else
    skp = 1;
end

if isfield(param,'make_avi');  % save an avi video
    make_avi = param.make_avi;
else
    make_avi = 0;       
end

if isfield(param,'name');  % # of repetitions
    name = param.name;
else
    name = ['video_',datestr(now,30),'.avi'];        % default number of repetitions
end

T = size(C,2);

if ismatrix(Y)
    Yr = Y;
    Y = reshape(Y,d1,d2,T);
else
    Yr = reshape(Y,d1*d2,T);
end