function y = myFunc(tR,mode)
if ~isfield(tR, 'isAvailable')
tR.isAvailable= false;
end
if tR.isAvailable
y = fullfile(workingFolder,'file.txt');
else
y = '';
switch(mode)
case '1'
.....
case '2'
.....
end
end
when I call myFunc(tR,'1') it'es OK but I would also to be able to call myFunc sometimes without the mode just myFunc(tR)
how could I say in some cases within the function myFunc don't execute the switch case when the mode varaible isn't provided in arguments ?