Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ERROR: 'You must call TIC without an output argument before calling TOC without an input argument.'

I have this error while running my gui and I don't understand what it means and how to fix it... any ideas?

Error using toc
You must call TIC without an output argument before calling TOC without an
input argument.

 Error in hand_rotation2/youPress (line 126)
         c = toc;

 Error while evaluating figure KeyPressFcn
like image 919
user1742463 Avatar asked Oct 15 '12 16:10

user1742463


2 Answers

You can use tic/toc in the following ways:

% tic without output argument
tic;
rand(10);
% toc without input argument
te=toc;

or

% tic with output argument
ts=tic;
rand(10);
% toc with input argument
te=toc(ts);

You can not mix the above scenarios, e.g.,

ts=tic;
rand(10);
te=toc;   % wrong! toc must be called as toc(ts)

Error using toc
You must call TIC without an output argument before calling TOC without an input
argument.
like image 141
angainor Avatar answered Nov 03 '22 23:11

angainor


You are using tic / toc matlab functions, these are used for measuring times. The message is telling you that toc is calling without previously tic calling, you can either remove line 126 or invoking tic firstly.

like image 37
jabaldonedo Avatar answered Nov 03 '22 22:11

jabaldonedo