Assignment replacement operator commands for managing

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: gnment (replacement) operator. Commands for Managing a Session clc clear exist global help lookfor quit who whos Clears Command window. Removes variables from memory. Checks for existence of file or variable. Declares variables to be global. Searches for a help topic. Searches help entries for a keyword. Stops MATLAB. Lists current variables. Lists current variables (long display). MATLAB Commands – 3 Special Variables and Constants ans eps i,j Inf NaN pi Most recent answer. Accuracy of floating-point precision. The imaginary unit - 1. Infinity. Undefined numerical result (not a number). The number p . System and File Commands cd date delete diary dir load path pwd save type what wklread Changes current directory. Displays current date. Deletes a file. Switches on/off diary file recording. Lists all files in current directory. Loads workspace variables from a file. Displays search path. Displays current directory. Saves workspace variables in a file. Displays contents of a file. Lists all MATLAB files in the current directory. Reads .wk1 spreadsheet file. MATLAB Commands – 4 Input/Output and Formatting Commands Input/Output Commands disp fscanf format fprintf input ; Displays contents of an array or string. Read formatted data from a file. Controls screen-display format. Performs formatted writes to screen or file. Displays prompts and waits for input. Suppresses screen printing. Format Codes for fprintf and fscanf %s %d %f %e %g \n \t Format as a string. Format as an integer. Format as a floating point value. Format as a floating point value in scientific notation. Format in the most compact form: %f or %e. Insert a new line in the output string. Insert a tab in the output string. Numeric Display Formats format format format format format format format format format short long short e long e bank + rat compact loose Four decimal digits (default). 16 decimal digits. Five digits plus exponent. 16 digits plus exponents. Two decimal digits. Positive, negative, or zero. Rational approximation. Suppresses some line feeds. Resets to less compact display mode. MATLAB Commands – 5 Vector, Matrix and Array Commands Array Commands cat find length linspace logspace max min prod reshape size sort sum Concatenates arrays. Finds indices of nonzero elements. Computers number of elements. Creates regularly spaced vector. Creates logarithmically spaced vector. Returns largest element. Returns smallest element. Product of each column. Change size Computes array size. Sorts each column. Sums each column. Special Matrices eye ones zeros Creates an identity matrix. Creates an array of ones. Creates an array of zeros. Matrix Arithmetic cross dot Computes cross products. Computes dot prod...
View Full Document

This note was uploaded on 08/10/2013 for the course ENGINEERIN 7 taught by Professor Patzek during the Summer '08 term at University of California, Berkeley.

Ask a homework question - tutors are online