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: size.m
    path of file: ./repos/scGEAToolbox/tensor_toolbox/@ktensor
    
    the code of the file until where you have to start completion: function m = size(t, idx)
%SIZE Size of ktensor.
%
%   D = SIZE(T) returns the size of the tensor.
%

    
function m = size(t, idx)
%SIZE Size of ktensor.
%
%   D = SIZE(T) returns the size of the tensor.
%
%   I = SIZE(T,DIM) returns the size of the dimension specified by
%   the scalar DIM.
%
%   See also KTENSOR, KTENSOR/NDIMS.
%
%Tensor Toolbox for MATLAB: <a href="https://www.tensortoolbox.org">www.tensortoolbox.org</a>


if isempty(t.lambda)
    m = [];
end