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: times.m
    path of file: ./repos/chebfun/@diskfun
    
    the code of the file until where you have to start completion: function h = times(f,g)
%.*   Pointwise multiplication for DISKFUN objects.
%   F.*G multiplies DISKFUN objects F and G. Alternatively F or G could be 
%   a double.

% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.

if ( isa(f, 'diskfun') && isa(g, 'diskfun') )
    % Grady's faster times for rank 1 functions: 
    if ( length( f ) == 1 ) 
        [C, D, R] = cdr(f); 
        h = g;
        onesForC = sqrt(abs(D)) * ones(1, length(g));
        onesForR = sign(D) * onesForC;

    
function h = times(f,g)
%.*   Pointwise multiplication for DISKFUN objects.
%   F.*G multiplies DISKFUN objects F and G. Alternatively F or G could be 
%   a double.

% Copyright 2017 by The University of Oxford and The Chebfun Developers.
% See http://www.chebfun.org/ for Chebfun information.

if ( isa(f, 'diskfun') && isa(g, 'diskfun') )
    % Grady's faster times for rank 1 functions: 
    if ( length( f ) == 1 ) 
        [C, D, R] = cdr(f); 
        h = g;
        onesForC = sqrt(abs(D)) * ones(1, length(g));
        onesForR = sign(D) * onesForC;
        h.cols = (C * onesForC) .* g.cols;
        h.rows = (R * onesForR) .* g.rows;
        % Switch the parity terms if needed: 
        % plus*plus = plus -> do nothing
        % plus*minus = minus -> do nothing
        % minus*minus = plus -> switch minus to plus
        % minus*plus = minus -> switch plus to minus
        if ( isempty(f.idxPlus) )  % f is a minus
            h.idxMinus = g.idxPlus;
            h.idxPlus = g.idxMinus;
        end