5.0

5.0 | 1 rating Rate this file 3 Downloads (last 30 days) File Size: 2.83 KB File ID: #30534

Whos

by Matt J

 

24 Feb 2011 (Updated 29 Mar 2011)

Variant of whos(). Gives memory in Kbytes and displays array dimensions even for 4D+ arrays.

| Watch this File

File Information
Description

 "Whos" is a customized version of MATLAB's usual "whos" function.

The differences are,
 
  (1) "Whos" will compute/display memory in kilobytes whereas "whos" displays in bytes.
 
  (2) "Whos" will always display all array dimensions whereas "whos" will not display array dimensions for 4th and higher dimensional arrays.
      
 
EXAMPLE: Given the following arrays
 
   A=rand(10,20,30,40);
   B=rand(5,10,15,20,25,'single')*i;
 
using "whos" displays the following:
 
 >> whos
    Name Size Bytes Class Attributes
  
    A 4-D 1920000 double
    B 5-D 3000000 single complex
 
 
whereas Whos will display the following
 
 >> Whos
    Name Size Kilobytes Class Attributes
                    
    A 10x20x30x40 1875 double
    B 5x10x15x20x25 2930 single complex
 
An unfortunate limitation is that Whos relies on EVALIN and so will not work correctly in a workspace context reached using DBUP and DBDOWN. I elaborate on this somewhat in this Newsgroup thread:
 
       http://www.mathworks.com/matlabcentral/newsreader/view_thread/303357
 
Hopefully, TMW will provide a way around this eventually.

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File  
Everyone's Tags
4d, dimension, dimensions, kilobytes, memory, size, whos
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
25 Feb 2011 Christian Wörner  
Updates
24 Feb 2011

Small bug fix. Rendering of sizes MxNxPxQ... could have appeared as MxxNxPxx or some variety of this.

29 Mar 2011

Right-justified the "Kilobytes" column. Also, memory greater than 10KB is now rounded up to integers.

Contact us