Got Questions? Get Answers.
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:
How to get CPU usage of processes in matlab

Subject: How to get CPU usage of processes in matlab

From: ali

Date: 28 Dec, 2009 12:10:04

Message: 1 of 17

pls
somebody if know or have codes for that post it is so urgent but no answer..
thnaks alot for attention

Subject: How to get CPU usage of processes in matlab

From: ImageAnalyst

Date: 28 Dec, 2009 16:54:44

Message: 2 of 17

On Dec 28, 7:10 am, "ali " <rebelfi...@gmail.com> wrote:
> pls
> somebody if know or have codes for that post it is so urgent but no answer..
> thnaks alot for attention

--------------
Did you try running the profiler tool from the Tools pulldown menu?

Subject: How to get CPU usage of processes in matlab

From: ali

Date: 29 Dec, 2009 08:25:04

Message: 3 of 17

yeah ı ı tried it but there isnt cpu usage for m file
only time for running process..
pls help me
thanks for attention

Subject: How to get CPU usage of processes in matlab

From: ImageAnalyst

Date: 29 Dec, 2009 15:28:44

Message: 4 of 17

On Dec 29, 3:25 am, "ali " <rebelfi...@gmail.com> wrote:
> yeah ı ı tried it but there isnt cpu usage for m file
> only time for running process..
> pls help me
> thanks for attention

---------------------------------------
Do you want to know the percentage of time that the CPU spends in your
process (like the CPU is spending 42% of its time on your process), or
the amount of time it spends on the functions in your m-file (use the
Profiler tool)?
What operating system are you using?
Have you tried typing control-shift-escape in Windows XP (if that's
what you're using)?

Subject: How to get CPU usage of processes in matlab

From: ali

Date: 30 Dec, 2009 16:47:04

Message: 5 of 17

thanks for attention

ı know about profiler tool but
only there how much time function use CPU
but ı dont want this
ı want
for example kmeans function uses cpu when working %14 but no cpu time cpu usage like windows task manager is there command or function for this or if we cant take for function then maybe how much matlab use cpu when working during the proces.
thanks for attention

Subject: How to get CPU usage of processes in matlab

From: us

Date: 30 Dec, 2009 16:56:06

Message: 6 of 17

"ali " <rebelfirst@gmail.com> wrote in message <hhg068$csm$1@fred.mathworks.com>...
> thanks for attention
>
> ı know about profiler tool but
> only there how much time function use CPU
> but ı dont want this
> ı want
> for example kmeans function uses cpu when working %14 but no cpu time cpu usage like windows task manager is there command or function for this or if we cant take for function then maybe how much matlab use cpu when working during the proces.
> thanks for attention

this nice utility does what you want...
- if(f) you work on a wintel system

http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx

us

Subject: How to get CPU usage of processes in matlab

From: ali

Date: 4 Jan, 2010 08:03:04

Message: 7 of 17

thanks so much ı want like this.
ı wish someone know command about matlab cpu usage
thanks for attention again...

Subject: How to get CPU usage of processes in matlab

From: us

Date: 4 Jan, 2010 08:13:03

Message: 8 of 17

"ali " <rebelfirst@gmail.com> wrote in message <hhs7bn$6gb$1@fred.mathworks.com>...
> thanks so much ı want like this.
> ı wish someone know command about matlab cpu usage
> thanks for attention again...

did you try the utility shown in a previous reply(?)...

us

Subject: How to get CPU usage of processes in matlab

From: tina harris

Date: 4 Jan, 2010 09:33:45

Message: 9 of 17

hey,
did u try using Matlab help..???

Subject: How to get CPU usage of processes in matlab

From: Sherryl Radbil

Date: 12 Jan, 2010 21:59:06

Message: 10 of 17

Thanks us.
Process Explorer is a very useful GUI but it doesn't seem to have a command line interface which is what I am looking for.

I need a command line interface (not a GUI) that can give me the same number you see in the Task Manager in the CPU column.

I did find WMIC which runs on XP Professional and is in the right direction but it does not seem to be able to give me just the % CPU usage of matlab.exe (the only thing I'm interested in).

Read about WMIC starting here:
http://technet.microsoft.com/en-us/library/bb742610.aspx

Here are some examples:
Examples:
C:\ >wmic PROCESS WHERE (Description="matlab.exe") GET KernelModeTime,VirtualSize
KernelModeTime VirtualSize
97968750 808247296

C:\ wmic PROCESS WHERE (Description="matlab.exe") list brief
HandleCount Name Priority ProcessId ThreadCount WorkingSetSize
1363 MATLAB.exe 8 3840 49 243838976

Getting help:
wmic process /?
wmic process get /?

Anybody know a way to get % CPU usage from the command line?
Thanks,
Sherryl

Subject: How to get CPU usage of processes in matlab

From: ali

Date: 13 Jan, 2010 16:37:05

Message: 11 of 17

is there command for that pls help for cpu usage

Subject: How to get CPU usage of processes in matlab

From: ali

Date: 19 Jan, 2010 12:02:05

Message: 12 of 17

pls help

command line prompt is there be with matlab.???

Subject: How to get CPU usage of processes in matlab

From: ali

Date: 5 Feb, 2010 12:27:05

Message: 13 of 17

ı cant find any command for that
only ıcan see
matlab exe in task manager
so anybody know about that?

Subject: How to get CPU usage of processes in matlab

From: Xin Zhao

Date: 12 Feb, 2010 19:14:21

Message: 14 of 17

Hi Ali,
  check it out.
http://www.mathworks.com/matlabcentral/fileexchange/26662-system-information-class-for-windows

-Shin

"ali " <rebelfirst@gmail.com> wrote in message <hkh2qp$duu$1@fred.mathworks.com>...
> ı cant find any command for that
> only ıcan see
> matlab exe in task manager
> so anybody know about that?

Subject: How to get CPU usage of processes in matlab

From: Ben

Date: 24 Apr, 2013 16:41:08

Message: 15 of 17

try this java class instead for a cross-platform solution:

https://github.com/jezhumble/javasysmon

so in matlab, you'd add:

javaaddpath('/full/path/to/javasysmon-0.3.4.jar');
import com.jezhumble.javasysmon.JavaSysMon.*
object=com.jezhumble.javasysmon.JavaSysMon();
next_cpu=object.cpuTimes();
pause(1);
next_cpu=object.cpuTimes();
disp([num2str(round(100*last_cpu.getCpuUsage(next_cpu))) '% cpu']);
mem=object.physical();
disp([num2str(round(100*(mem.getTotalBytes()-mem.getFreeBytes())/mem.getTotalBytes())) '% mem']);

Subject: How to get CPU usage of processes in matlab

From: reza

Date: 24 Apr, 2013 18:26:36

Message: 16 of 17

On Friday, February 5, 2010 7:27:05 AM UTC-5, ali wrote:
> ı cant find any command for that
> only ıcan see
> matlab exe in task manager
> so anybody know about that?

Use the undocumented feature() function. In particular type

>> feature timing

to see all available options. I think you need

>> feature timing cpucount

for more feature() options see "undocumentedmatlab.com/blog/undocumented-feature-function"


/reza

Subject: How to get CPU usage of processes in matlab

From: Avner Atias

Date: 21 Jan, 2014 09:39:08

Message: 17 of 17

Hi Ben,

I keep getting the following error message:
'Undefined variable "com" or class "com.jezhumble.javasysmon.JavaSysMon"

even though I put the right path in the addpath command. What else am I doing wrong?

Thanks,

Avner

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