Rules | Recent posts | topic RSS | Search | Register  | Log in

test speed of a m-file?

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital Signal Processing
Author Message
Xellos



Joined: 06 Jan 2005
Posts: 8


Post06 Feb 2005 22:41   test speed of a m-file?

In what situation, you can get a fast result of running a program once.

Thx.
Back to top
nicleo



Joined: 06 Sep 2004
Posts: 717
Helped: 60


Post07 Feb 2005 1:16   test speed of a m-file?

If you would to know how long a m-file is executed, you can do as follows:

TimeStart = cputime; % At the beginning of the m-file
TimeConsumed = cputime-TimeStart; % At the end of the m-file
Back to top
brmadhukar



Joined: 21 Jun 2002
Posts: 844
Helped: 29


Post07 Feb 2005 17:07   Re: test speed of a m-file?

Hi,
you need to
1) avoid declaring new variable in a loop.
2) avoid indexing that grows in a loop
3) predefine arrays with zero
4) use LUTs
hope this helps
brmadhukar
Back to top
Xellos



Joined: 06 Jan 2005
Posts: 8


Post07 Feb 2005 21:54   test speed of a m-file?

thanks a lot!

Added after 4 hours 40 minutes:

another question please!
how can matlab calculates with uint8 data?
I know it can only tell one uint8 number bigger than another uint8. Can it do the addition with uint8 numbers.

or if compile m-file to a c++ program, will it be faster? if so, how to test the speed of a c program?

thanks for your time!!!
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital Signal Processing
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap