Info

此问题已关闭。 请重新打开它进行编辑或回答。

Gui, timer function, CAT arguments error

1 次查看(过去 30 天)
adrs
adrs 2015-1-28
关闭: MATLAB Answer Bot 2021-8-20
Hi, Could you please help me?
I have created a GUI in Matlab and I want to excute a certain function every x seconds. I have used a timer function, but I am getting the following error:
??? Error while evaluating TimerFcn for timer 'timer-11'
CAT arguments dimensions are not consistent.
I don't know because I am getting the CAT arguments error.
The code is something like this.
I create the timer function just before the GUI is made visible:
handles.tmr = timer('TimerFcn',{@TmrFcn,handles.guifig},'BusyMode','Queue',...
'ExecutionMode','FixedRate','Period',0.5);
Then in the core code of the GUI, I excute the timer function once:
if (i>610)&&(x==0)
start(handles.tmr);
x=1;
end;
The timer function is as follow:
function TmrFcn(src,event,handles) %Timer function
global v2 %where v2 is a vector of constant size that keeps changing its content.
handles = guidata(handles);
[loc]=PruebaVF(v2); % Here I call a function to be executed.
end
Thanks
  1 个评论
Geoff Hayes
Geoff Hayes 2015-1-28
adrs - what is happening in the PruebaVF function? Is there some concatenation going on there? Run the following command in the Command Window
dbstop if error
and then relaunch your GUI. When the error occurs, the debugger will pause at the line that has thrown the error. What is happening at that line?

回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by