MATLAB: Does the timer function always say I have too many output arguments

ibmatlabMATLABtimetimefcntimer

I am building a simple automated stock trading system. I can enter trades that will not be executed until certain criteria are met. I am trying to check every minute if any of the potential trades have met their criteria. This is done with a timer object initialized in the app calling a function that calls a script from a different file. I tried doing this calling the script directly but had no success. I think it is because the vector that holds all possible trades is changing in size.
function startupFcn(app)
app.allTrades = [];
setGlobalT([]);
t = timer('StartDelay', 0, 'Period', 5, 'ExecutionMode', 'fixedRate','TimerFcn',@myFun);
start(t);
function myFun(obj, event)
AWS(app.allTrades);
end
end
The AWS script is the one that does the checking. The code is below.
function AWS(allTrades)
disp('in AWS');
for i=1:length(allTrades)
disp('in for');
DOIT = 0;
DOIT = act(allTrades(i));
if DOIT == 1
allTrades(i) = [];
end
end
end

Best Answer

The issue was not resolved with any of the suggested methods. I appreciate all of the help but I found that I had assigned the output of the function to a variable at one point and did not specify that there would be an output in the function file itself. Thanks all for your time.