Upcoming SlideShare
×

# Matlab1

1,606 views
1,567 views

Published on

0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
1,606
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
94
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Matlab1

1. 1. Matlab Lecture 1 - Introduction to MATLAB <ul><li>MATLAB is a high-performance language for technical computing . It integrates computation, visualization, and programming in an easy-to-use environment. Typical uses include: </li></ul><ul><ul><li>Math and computation </li></ul></ul><ul><ul><li>Algorithm development </li></ul></ul><ul><ul><li>Modeling, simulation, and prototyping </li></ul></ul><ul><ul><li>Data analysis, exploration, and visualization </li></ul></ul><ul><ul><li>Scientific and engineering graphics </li></ul></ul><ul><li>MATLAB is an interactive system whose basic data element is an array that does not require dimensioning. This allows you to solve many technical computing problems, especially those with matrix and vector formulations, in a fraction of the time it would take to write a program in a scalar non-interactive language such as C or Fortran. </li></ul>
2. 2. Command Window Command History Workspace Fig: Snap shot of matlab
3. 3. Entering Matrices - Method 1:Direct entry <ul><li>4 ways of entering matrices in MATLAB : </li></ul><ul><ul><li>Enter an explicit list of elements </li></ul></ul><ul><ul><li>Load matrices from external data files </li></ul></ul><ul><ul><li>Generate matrices using built-in functions </li></ul></ul><ul><ul><li>Create matrices with your own functions in M-files </li></ul></ul><ul><li>Rules of entering matrices : </li></ul><ul><ul><li>Separate the elements of a row with blanks or commas </li></ul></ul><ul><ul><li>Use a semicolon “ ; “ to indicate the end of each row </li></ul></ul><ul><ul><li>Surround the entire list of elements with square brackets , [ ] </li></ul></ul><ul><li>To enter Dürer's matrix, simply type: </li></ul><ul><ul><li>» A = [16 3 2 13; 5 10 11 8; 9 6 7 12; 4 15 14 1] </li></ul></ul><ul><li>MATLAB displays the matrix you just entered, </li></ul><ul><ul><li>A = </li></ul></ul><ul><ul><li>16 3 2 13 </li></ul></ul><ul><ul><li>5 10 11 8 </li></ul></ul><ul><ul><li>9 6 7 12 </li></ul></ul><ul><ul><li>4 15 14 1 </li></ul></ul>No need to define or declare size of A
4. 4. Entering Matrices - as lists <ul><li>Why is this a magic square? Try this in Matlab :- </li></ul><ul><ul><li>» sum(A) </li></ul></ul><ul><ul><li>ans = </li></ul></ul><ul><ul><li>34 34 34 34 </li></ul></ul><ul><ul><li>» A’ </li></ul></ul><ul><ul><li>ans = </li></ul></ul><ul><ul><li>16 5 9 4 </li></ul></ul><ul><ul><li>3 10 6 15 </li></ul></ul><ul><ul><li>2 11 7 14 </li></ul></ul><ul><ul><li>13 8 12 1 </li></ul></ul><ul><ul><li>» sum(A’)’ </li></ul></ul><ul><ul><li>ans = 34 </li></ul></ul><ul><ul><li> 34 </li></ul></ul><ul><ul><li>34 </li></ul></ul><ul><ul><li>34 </li></ul></ul>Compute the sum of each column in A Result in row vector variable ans Transpose matrix A Result in column vector variable ans Compute the sum of each row in A
5. 5. Entering Matrices - subscripts <ul><li>A(i,j) refers to element in row i and column j of A :- </li></ul><ul><ul><li>» A(4,2) </li></ul></ul><ul><ul><li>ans = 15 </li></ul></ul><ul><ul><li>» A(1,4) + A(2,4) + A(3,4) + A(4,4) </li></ul></ul><ul><ul><li>ans = 34 </li></ul></ul><ul><ul><li>» X = A; </li></ul></ul><ul><ul><li>» X(4,5) = 17 </li></ul></ul><ul><ul><li>X = </li></ul></ul><ul><ul><li>16 3 2 13 0 </li></ul></ul><ul><ul><li>5 10 11 8 0 </li></ul></ul><ul><ul><li>9 6 7 12 0 </li></ul></ul><ul><ul><li>4 15 14 1 17 </li></ul></ul>row col Slow way of finding sum of column 4 Make another copy of A in X ‘ ;’ suppress output Add one element in column 5, auto increase size of matrix
6. 6. Entering Matrices - colon : Operator <ul><li>‘:’ used to specify range of numbers </li></ul><ul><ul><li>» 1:10 </li></ul></ul><ul><ul><li>ans = 1 2 3 4 5 6 7 8 9 10 </li></ul></ul><ul><ul><li>» 100:-7:50 </li></ul></ul><ul><ul><li>ans = 100 93 86 79 72 65 58 51 </li></ul></ul><ul><ul><li>» 0:pi/4:pi </li></ul></ul><ul><ul><li>ans = 0 0.7854 1.5708 2.3562 3.1416 </li></ul></ul><ul><ul><li>» A(1:k,j); </li></ul></ul><ul><ul><li>» sum(A(1:4,4)) </li></ul></ul><ul><ul><li>ans = 34 </li></ul></ul><ul><ul><li>» sum(A(:,end)) </li></ul></ul><ul><ul><li>ans = 34 </li></ul></ul>end start incr ‘ 0’ to ‘pi’ with incr. of ‘pi/4’ First k elements of the j th column in A last col Short-cut for “all rows”
7. 7. Expressions & built-in functions <ul><ul><li>» rho = (1+sqrt(5))/2 </li></ul></ul><ul><ul><li>rho = 1.6180 </li></ul></ul><ul><ul><li>» a = abs(3+4i) </li></ul></ul><ul><ul><li>a = 5 </li></ul></ul><ul><ul><li>» z = sqrt(besselk(4/3,rho-i)) </li></ul></ul><ul><ul><li>z = 0.3730+ 0.3214i </li></ul></ul><ul><ul><li>» huge = exp(log(realmax)) </li></ul></ul><ul><ul><li>huge = 1.7977e+308 </li></ul></ul><ul><ul><li>» toobig = pi*huge </li></ul></ul><ul><ul><li>toobig = Inf </li></ul></ul><ul><li>pi 3.14159265 </li></ul><ul><li>I or j Imaginary unit, -1 </li></ul><ul><li>eps FP relative precision, 2 -52 </li></ul><ul><li>realmin Smallest FP number, 2 -1022 </li></ul><ul><li>realmax Largest FP number, (2-)2 1023 </li></ul><ul><li>Inf Infinity </li></ul><ul><li>NaN Not-a-number </li></ul>Elementary functions Complex number Special functions Built-in constants (function)
8. 8. Entering Matrices Method 2: Generation <ul><ul><li>» Z = zeros(2,4) </li></ul></ul><ul><ul><li>Z = 0 0 0 0 </li></ul></ul><ul><ul><li>0 0 0 0 </li></ul></ul><ul><ul><li>» F = 5*ones(3,3) </li></ul></ul><ul><ul><li>F = 5 5 5 </li></ul></ul><ul><ul><li>5 5 5 </li></ul></ul><ul><ul><li>5 5 5 </li></ul></ul><ul><ul><li>» N = fix(10*rand(1,10)) </li></ul></ul><ul><ul><li>N = 4 9 4 4 8 ... </li></ul></ul><ul><ul><li>» R = randn(4,4) </li></ul></ul><ul><ul><li>R = 1.0668 0.2944 0.6918 -1.4410 </li></ul></ul><ul><ul><li>0.0593 -1.3362 0.8580 0.5711 </li></ul></ul><ul><ul><li>-0.0956 0.7143 1.2540 -0.3999 </li></ul></ul><ul><ul><li>-0.8323 1.6236 -1.5937 0.6900 </li></ul></ul><ul><li>Useful Generation Functions </li></ul><ul><li>zeros All zeros </li></ul><ul><li>ones All ones </li></ul><ul><li>rand Uniformly distributed random </li></ul><ul><li>elements between (0.0, 1.0) </li></ul><ul><li>randn Normally distributed random </li></ul><ul><li>elements, mean = 0.0, var = 1.0 </li></ul><ul><li>fix Convert real to integer </li></ul>
9. 9. Entering Matrices - Method 3 & 4: Load & M-File <ul><ul><ul><li>16.0 3.0 2.0 13.0 </li></ul></ul></ul><ul><ul><ul><li>5.0 10.0 11.0 8.0 </li></ul></ul></ul><ul><ul><ul><li>9.0 6.0 7.0 12.0 </li></ul></ul></ul><ul><ul><ul><li>4.0 15.0 14.0 1.0 </li></ul></ul></ul>magik.dat <ul><ul><ul><li>A = [ ... </li></ul></ul></ul><ul><ul><ul><li>16.0 3.0 2.0 13.0 </li></ul></ul></ul><ul><ul><ul><li>5.0 10.0 11.0 8.0 </li></ul></ul></ul><ul><ul><ul><li>9.0 6.0 7.0 12.0 </li></ul></ul></ul><ul><ul><ul><li>4.0 15.0 14.0 1.0]; </li></ul></ul></ul>magik.m Three dots (…) means continuation to next line <ul><ul><li>» magik </li></ul></ul>.m files can be run by just typing its name in Matlab <ul><ul><li>» load magik.dat </li></ul></ul>Read data from file into variable magik
10. 10. Entering Matrices - Concatenate & delete <ul><ul><li>» B = [A A+32; A+48 A+16] </li></ul></ul><ul><ul><li>B = </li></ul></ul><ul><ul><li>16 3 2 3 48 35 34 45 </li></ul></ul><ul><ul><li>5 10 11 8 37 42 43 40 </li></ul></ul><ul><ul><li>9 6 7 12 41 38 39 44 </li></ul></ul><ul><ul><li>4 15 14 1 36 47 46 33 </li></ul></ul><ul><ul><li>64 51 50 61 32 19 18 29 </li></ul></ul><ul><ul><li>53 58 59 56 21 26 27 24 </li></ul></ul><ul><ul><li>57 54 55 60 25 22 23 28 </li></ul></ul><ul><ul><li>52 63 62 49 20 31 30 17 </li></ul></ul><ul><ul><li>» X = A; </li></ul></ul><ul><ul><li>» X(:,2) = [] </li></ul></ul><ul><ul><li>X = </li></ul></ul><ul><ul><li>16 2 13 </li></ul></ul><ul><ul><li>5 11 8 </li></ul></ul><ul><ul><li>9 7 12 </li></ul></ul><ul><ul><li>4 14 1 </li></ul></ul>2nd column deleted
11. 11. MATLAB as a calculator <ul><li>MATLAB can be used as a ‘clever’ calculator </li></ul><ul><ul><li>This has very limited value in engineering </li></ul></ul><ul><li>Real value of MATLAB is in programming </li></ul><ul><ul><li>Want to store a set of instructions </li></ul></ul><ul><ul><li>Want to run these instructions sequentially </li></ul></ul><ul><ul><li>Want the ability to input data and output results </li></ul></ul><ul><ul><li>Want to be able to plot results </li></ul></ul><ul><ul><li>Want to be able to ‘make decisions’ </li></ul></ul>
12. 12. Example revisited <ul><li>Can do using MATLAB as a calculator </li></ul><ul><ul><li>>> x = 1:10; </li></ul></ul><ul><ul><li>>> term = 1./sqrt(x); </li></ul></ul><ul><ul><li>>> y = sum(term); </li></ul></ul><ul><li>Far easier to write as an M-file </li></ul>
13. 13. How to write an M-file <ul><li>File -> New -> M-file </li></ul><ul><li>Takes you into the file editor </li></ul><ul><li>Enter lines of code (nothing happens) </li></ul><ul><li>Save file (we will call ours L2Demo.m) </li></ul><ul><li>Exit file </li></ul><ul><li>Run file </li></ul><ul><li>Edit ( ie modify) file if necessary </li></ul>
14. 14. <ul><li>n = input(‘Enter the upper limit: ‘); </li></ul><ul><li>x = 1:n; % Matlab is case sensitive </li></ul><ul><li>term = sqrt(x); </li></ul><ul><li>y = sum(term) </li></ul><ul><li>What happens if n < 1 ? </li></ul>
15. 15. <ul><li>n = input(‘Enter the upper limit: ‘); </li></ul><ul><li>if n < 1 </li></ul><ul><ul><li>disp (‘Your answer is meaningless!’) </li></ul></ul><ul><li>end </li></ul><ul><li>x = 1:n; </li></ul><ul><li>term = sqrt(x); </li></ul><ul><li>y = sum(term) </li></ul>Jump to here if TRUE Jump to here if FALSE
16. 16. Example of a MATLAB Function File <ul><li>function [ a , b ] = swap ( a , b ) </li></ul><ul><li>% The function swap receives two values, swaps them, </li></ul><ul><li>% and returns the result. The syntax for the call is </li></ul><ul><li>% [a, b] = swap (a, b) where the a and b in the ( ) are the </li></ul><ul><li>% values sent to the function and the a and b in the [ ] are </li></ul><ul><li>% returned values which are assigned to corresponding </li></ul><ul><li>% variables in your program. </li></ul><ul><li>temp=a; </li></ul><ul><li>a=b; </li></ul><ul><li>b=temp; </li></ul>
17. 17. Example of a MATLAB Function File <ul><li>To use the function a MATLAB program could assign values to two variables (the names do not have to be a and b) and then call the function to swap them. For instance the MATLAB commands: </li></ul><ul><li>>> x = 5 ; y = 6 ; [ x , y ] = swap ( x , y ) </li></ul><ul><li>result in: </li></ul><ul><li>x = </li></ul><ul><li>6 </li></ul><ul><li>y = </li></ul><ul><li>5 </li></ul>
18. 18. MATLAB Function Files <ul><li>Referring to the function, the comments immediately following the function definition statement are the &quot;help&quot; for the function. The MATLAB command: </li></ul><ul><li>>>help swap %displays: </li></ul><ul><li>The function swap receives two values, swaps them, </li></ul><ul><li>and returns the result. The syntax for the call is </li></ul><ul><li>[a, b] = swap (a, b) where the a and b in the ( ) are the </li></ul><ul><li>values sent to the function and the a and b in the [ ] are </li></ul><ul><li>returned values which are assigned to corresponding </li></ul><ul><li>variables in your program. </li></ul>
19. 19. Decision making in MATLAB <ul><li>For ‘simple’ decisions? </li></ul><ul><li>IF … END (as in last example) </li></ul><ul><li>More complex decisions? </li></ul><ul><li>IF … ELSEIF … ELSE ... END </li></ul><ul><li>Example : Real roots of a quadratic equation </li></ul>
20. 20. Roots of ax 2 +bx+c=0 <ul><li>Roots set by discriminant </li></ul><ul><li>Δ < 0 (no real roots) </li></ul><ul><li>Δ = 0 (one real root) </li></ul><ul><li>Δ > 0 (two real roots) </li></ul><ul><li>MATLAB needs to make decisions (based on Δ ) </li></ul>
21. 21. One possible M-file <ul><li>Read in values of a, b, c </li></ul><ul><li>Calculate Δ </li></ul><ul><li>IF Δ < 0 </li></ul><ul><li>Print message ‘ No real roots’-> Go END </li></ul><ul><li>ELSEIF Δ = 0 </li></ul><ul><li>Print message ‘One real root’-> Go END </li></ul><ul><li>ELSE </li></ul><ul><li>Print message ‘Two real roots’ </li></ul><ul><li>END </li></ul>
22. 22. My M-file <ul><li>%========================================================== </li></ul><ul><li>% Demonstration of an m-file </li></ul><ul><li>% Calculate the real roots of a quadratic equation </li></ul><ul><li>%========================================================== </li></ul><ul><li>clear all; % clear all variables </li></ul><ul><li>clc; % clear screen </li></ul><ul><li>coeffts = input('Enter values for a,b,c (as a vector): '); % Read in equation coefficients </li></ul><ul><li>a = coeffts(1); </li></ul><ul><li>b = coeffts(2); </li></ul><ul><li>c = coeffts(3); </li></ul><ul><li>delta = b^2 - 4*a*c; % Calculate discriminant </li></ul><ul><li>% Calculate number (and value) of real roots </li></ul><ul><li>if delta < 0 </li></ul><ul><li>fprintf(' Equation has no real roots: ') </li></ul><ul><li>disp(['discriminant = ', num2str(delta)]) </li></ul><ul><li>elseif delta == 0 </li></ul><ul><li>fprintf(' Equation has one real root: ') </li></ul><ul><li>xone = -b/(2*a) </li></ul><ul><li>else </li></ul><ul><li>fprintf(' Equation has two real roots: ') </li></ul><ul><li>x(1) = (-b + sqrt(delta))/(2*a); </li></ul><ul><li>x(2) = (-b – sqrt(delta))/(2*a); </li></ul><ul><li>fprintf(' First root = %10.2e Second root = %10.2f', x(1),x(2)) </li></ul><ul><li>end </li></ul>Header Initialisation Calculate Δ Make decisions based on value of Δ
23. 23. Command Window <ul><li> ctrl-p Recall previous line </li></ul><ul><li> ctrl-n Recall next line </li></ul><ul><li> ctrl-b Move back one character </li></ul><ul><li> ctrl-f Move forward one character </li></ul><ul><li>ctrl -  ctrl-r Move right one word </li></ul><ul><li>ctrl -  ctrl-l Move left one word </li></ul><ul><li>home ctrl-a Move to beginning of line </li></ul><ul><li>end ctrl-e Move to end of line </li></ul><ul><li>esc ctrl-u Clear line </li></ul><ul><li>del ctrl-d Delete character at cursor </li></ul><ul><li>backspace ctrl-h Delete character before cursor </li></ul><ul><li>ctrl-k Delete to end of line </li></ul>
24. 24. MATLAB Graphics_ Creating a Plot <ul><ul><li>» t = 0:pi/100:2*pi; </li></ul></ul><ul><ul><li>» y = sin(t); </li></ul></ul><ul><ul><li>» plot(t,y) </li></ul></ul><ul><ul><li>» grid </li></ul></ul><ul><ul><li>» axis([0 2*pi -1 1]) </li></ul></ul><ul><ul><li>» xlabel('0 leq itangle leq pi') </li></ul></ul><ul><ul><li>» ylabel('sin(t)') </li></ul></ul><ul><ul><li>» title('Graph of the sine function') </li></ul></ul><ul><ul><li>» text(1,-1/3,'it{Demonstration of plotting}') </li></ul></ul>
25. 25. PLOTTING MULTIPLE CURVES IN THE SAME PLOT There are two methods for plotting two curves in one plot: <ul><li>Using the plot command. </li></ul><ul><li>Using the hold on, hold off commands. </li></ul>
26. 26. USING THE PLOT COMMAND TO PLOT MULTIPLE CURVES The command: plot(x,y,u,v) plots y versus x and v versus u on the same plot. By default, the computer makes the curves in different colors. The curves can have a specific style by using: plot(x,y,’color_linestyle_marker’,u,v, ’color_linestyle_marker’) More curves can be added.
27. 27. Plot symbols commands <ul><li>Colors Symbols Lines </li></ul><ul><li>y – yellow . – point - – solid line </li></ul><ul><li>m – mag o – circle : – dots </li></ul><ul><li>c – cyan x – xmark -. – line dot </li></ul><ul><li>r – red + – plus - - – dashes </li></ul><ul><li>g – green * – star </li></ul><ul><li>b – blue s – square </li></ul><ul><li>w – white d – diamond </li></ul><ul><li>k – black v – triangle down ^ – triangle up < – left </li></ul><ul><li>< – right </li></ul><ul><li>p – pentagram </li></ul><ul><li>h – hexagram </li></ul>
28. 28. Plot the function below on a log-log graph. <ul><li>>> x = logspace(-1, 1, 100); </li></ul><ul><li>>> y = x.^2; </li></ul><ul><li>>> loglog(x, y) </li></ul><ul><li>A grid and additional labeling were provided and the curve is shown on the next slide. </li></ul>
29. 30. x=[0:0.1:10]; y=500-0.5*9.81*x.^2; xd=[0:10]; yd=[500 495 490 470 430 390 340 290 220 145 60]; plot(x,y,'g',xd,yd,'mo--') xlabel('TIME (s)') ylabel('HEIGHT (m)') title('Height as a Function of Time') legend('Model','Data') axis([0 11 0 600]) text(1,100,'Comparison between theory and experiment') EXAMPLE OF A FORMATTED PLOT WITH TWO CURVES Below is the script file of the falling object plot in lecture 4. Plot y versus x in green, and plot yd versus xd in magenta, circle markers, and dashed line. Creating a vector of time (data) xd Calculated height y for each x Creating a vector of time x Creating a vector of height (data) yd
30. 31. A PLOT WITH TWO CURVES
31. 32. Subplots For example, the command: subplot(3,2, p ) Creates 6 plots arranged in 3 rows and 2 columns. subplot(3,2,1) subplot(3,2,2) subplot(3,2,3) subplot(3,2,5) subplot(3,2,4) subplot(3,2,6)
32. 33. Example: Plot the 3-D surface described by the equation, in the region in the x-y plane from x = -5 to 5 and y = -4 to 4. Step 1) solve the equation for z, (continued on the next slide) 3-D Plotting
33. 34. Step 2) create two vectors x and y . The values of x and y will determine the region in the xy plane over which the surface is plotted. >> x = linspace(-3,3,7); >> y = linspace(-2,2,5); Step 3) Use the meshgrid function to create two matrices, X and Y . We will use these to compute Z . >> [X , Y] = meshgrid(x,y)
34. 35. X = Y =
35. 36. 5- Step 4) compute Z by using the X and Y created by meshgrid , >> R = sqrt(X.^2+Y.^2); >> Z = cos(X).*cos(Y).*exp(-R./4) Z =
36. 37. 5- Step 4) compute Z by using the X and Y created by meshgrid , >> R = sqrt(X.^2+Y.^2); >> Z = cos(X).*cos(Y).*exp(-R./4); Step 5) graph in 3-D by applying the surface function, >> surf(X,Y,Z);
37. 38. Subplots <ul><ul><li>» t = 0:pi/10:2*pi; </li></ul></ul><ul><ul><li>» [X,Y,Z] = cylinder(4*cos(t)); </li></ul></ul><ul><ul><li>» subplot(2,2,1); mesh(X) </li></ul></ul><ul><ul><li>» subplot(2,2,2); mesh(Y) </li></ul></ul><ul><ul><li>» subplot(2,2,3); mesh(Z) </li></ul></ul><ul><ul><li>» subplot(2,2,4); mesh(X,Y,Z) </li></ul></ul>
38. 39. Mesh & surface plots <ul><ul><li>» [X,Y] = meshgrid(-8:.5:8); </li></ul></ul><ul><ul><li>» R = sqrt(X.^2 + Y.^2) + eps; </li></ul></ul><ul><ul><li>» Z = sin(R)./R; </li></ul></ul><ul><ul><li>» mesh(X,Y,Z) </li></ul></ul><ul><ul><li>» text(15,10,'sin(r)/r') </li></ul></ul><ul><ul><li>» title('Demo of 2-D plot'); </li></ul></ul>
39. 40. MATLAB Graphics - Subplots <ul><li>Matlab official method: generate encapsulated postscript files - </li></ul><ul><ul><li>» print -depsc2 mesh.eps </li></ul></ul><ul><li>My method:- </li></ul><ul><ul><li>Use < PrintScreen > key (top right corner) – or any other screen capture utility - to capture the plot on screen </li></ul></ul><ul><ul><li>Use MS Photo Editor or similar bit-map editing program to cut out the the plot that I want </li></ul></ul><ul><ul><li>Paste it into MS Word or MS PowerPoint or save it as .BMP/.GIF file </li></ul></ul><ul><ul><li>Resize as necessary </li></ul></ul><ul><ul><li>Fit as many as required on page </li></ul></ul><ul><ul><li>Type written description (or report) if needed </li></ul></ul><ul><ul><li>Print document to any printer (not necessarily postscript printer) </li></ul></ul>
40. 41. MATLAB Environment (1) <ul><li>Managing Commands and Functions </li></ul><ul><ul><li>addpath Add directories to MATLAB's search path </li></ul></ul><ul><ul><li>help Online help for MATLAB functions and M-files </li></ul></ul><ul><ul><li>path Control MATLAB's directory search path </li></ul></ul><ul><li>Managing Variables and the Workspace </li></ul><ul><ul><li>clear Remove items from memory </li></ul></ul><ul><ul><li>length Length of vector </li></ul></ul><ul><ul><li>load Retrieve variables from disk </li></ul></ul><ul><ul><li>save Save workspace variables on disk </li></ul></ul><ul><ul><li>size Array dimensions </li></ul></ul><ul><ul><li>who, whos List directory of variables in memory </li></ul></ul>