- #1

- 9

- 2

I have a function in Matlab. I'd like to calculate the computation time of the function. How can I obtain the time? I think Matlab must include related functions as its internal functions.

Thanks in advance.

- MATLAB
- Thread starter hurryon
- Start date

- #1

- 9

- 2

I have a function in Matlab. I'd like to calculate the computation time of the function. How can I obtain the time? I think Matlab must include related functions as its internal functions.

Thanks in advance.

- #2

- 9

- 2

Thanks in advance.

- #3

- 422

- 1

Code:

```
time1 = cputime;
bench;
cputime - time1
```

- #4

- 2

- 0

Hello,

The tool in MATLAB built for this purpose is: "Profile".

In the MATLAB search at: "http://www.mathworks.com/" [Broken]

and typing "profile" will bring up the information.

Main commands are turning it on:

profile on

and viewing the results (after some execution):

profile viewer

kind regards.

The tool in MATLAB built for this purpose is: "Profile".

In the MATLAB search at: "http://www.mathworks.com/" [Broken]

and typing "profile" will bring up the information.

Main commands are turning it on:

profile on

and viewing the results (after some execution):

profile viewer

kind regards.

Last edited by a moderator:

- Replies
- 1

- Views
- 4K

- Replies
- 0

- Views
- 5K

- Last Post

- Replies
- 5

- Views
- 3K

- Last Post

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 0

- Views
- 2K

- Replies
- 4

- Views
- 2K

- Last Post

- Replies
- 0

- Views
- 3K

- Last Post

- Replies
- 2

- Views
- 3K

- Last Post

- Replies
- 1

- Views
- 1K

- Replies
- 2

- Views
- 23K