Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
I want to run a function file for every 10 seconds

Subject: I want to run a function file for every 10 seconds

From: chaitanya

Date: 14 Apr, 2010 01:48:21

Message: 1 of 3

Hi all.. I have an function file called"sunposition" that outputs the position of the sun in terms of azimuth & elevation. *imp* The function doesn't need any inputs. I have tried timer function but didn't work. My code looks like this :
t=timer;
set(t,'executionmode','fixedrate');
set(t,'period',10);
set(t,'timerfcn',@sun_position_modified);
start(t)
when i ran this i got the following error:
??? Error while evaluating TimerFcn for timer 'timer-1'
Too many input arguments.
I have gone through previous threads that dealt with the same problem, but I didn't understand. Please tell me how to get it running.
Thanks!!

Subject: I want to run a function file for every 10 seconds

From: norbert kirchgessner

Date: 14 Apr, 2010 06:58:03

Message: 2 of 3

"chaitanya " <chaitanya_309@yahoo.com> wrote in message <hq36t5$lc$1@fred.mathworks.com>...
> Hi all.. I have an function file called"sunposition" that outputs the position of the sun in terms of azimuth & elevation. *imp* The function doesn't need any inputs. I have tried timer function but didn't work. My code looks like this :
> t=timer;
> set(t,'executionmode','fixedrate');
> set(t,'period',10);
> set(t,'timerfcn',@sun_position_modified);
> start(t)
> when i ran this i got the following error:
> ??? Error while evaluating TimerFcn for timer 'timer-1'
> Too many input arguments.
> I have gone through previous threads that dealt with the same problem, but I didn't understand. Please tell me how to get it running.
> Thanks!!

Hi,
how does the declaration of your callback function look like?
in the help of timer there is a link to callback functions with an example of a callback declaration in the lower part

hth
kinor

Subject: I want to run a function file for every 10 seconds

From: us

Date: 14 Apr, 2010 08:22:05

Message: 3 of 3

"chaitanya " <chaitanya_309@yahoo.com> wrote in message <hq36t5$lc$1@fred.mathworks.com>...
> Hi all.. I have an function file called"sunposition" that outputs the position of the sun in terms of azimuth & elevation. *imp* The function doesn't need any inputs. I have tried timer function but didn't work. My code looks like this :
> t=timer;
> set(t,'executionmode','fixedrate');
> set(t,'period',10);
> set(t,'timerfcn',@sun_position_modified);
> start(t)
> when i ran this i got the following error:
> ??? Error while evaluating TimerFcn for timer 'timer-1'
> Too many input arguments.
> I have gone through previous threads that dealt with the same problem, but I didn't understand. Please tell me how to get it running.
> Thanks!!

a hint:
- this is a typical syntax problem...

http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_prog/f9-39541.html#f9-39598

us

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us