









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










Main Window – Opens when you start Matlab
help Online help for MATLAB functions and M-files
doc Starts the Matlab documentation viewer in a separate window.
lookfor Searches the help documentation for the keyword provided
cd change working directory
diary Test X = 44 Y = [4; 5; 6] diary off dir % Test1 is now in your working subdirectory - notice that there % is no file name extension.
X = 44
diary off
diary Test
diary off
diary off
diary off
Num_of_Students=50; Num_of_Teachers=1; - Perhaps most importantly, it is used to suppress displaying the contents of a variable. - This is extremely useful if the variable stores a long vector or a large matrix. - Example: Num_of_Students= will cause Num_of_Students =
50 to be displayed.
Column Vectors: are m×1 matrices, i.e., they consist of m rows and 1 column. Row Vectors: are 1 × m matrices, i.e., they consist of 1 row and m columns. Matrices: are two-dimensional rectangular array of real or complex numbers.
Using square brackets: – elements of a matrix are specified di- rectly; for example
v = [2 4 7] produces a row vector with 3 elements: v =
v=[2, 4, 7] yields the exact same result.
[1+2 2-2 3] and
Used frequently to pre-allocate storage for large arrays; more efficient that incremental allocation of storage. wavread You may have seen yy=wavread(fileanme) for reading in the samples from the soundclip stored in file filename. Many other functions: Try magic(5), hadamard(4), eye(5), rand(4), or many others. See also help elmat.
Via the colon (:) operator: The colon operator is one of the most useful operators in MATLAB.
xx =
yy =
ans =
Index exceeds matrix dimensions