0% found this document useful (0 votes)
74 views

Matlab Quick Reference Guide: Institute of Geodesy University of Stuttgart

This document provides a quick reference guide for commonly used Matlab functions. It lists and describes standard mathematical functions, matrix operations, statistical operators, linear algebra functions, graphics functions, and programming structures in Matlab.

Uploaded by

Diwas Poudel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views

Matlab Quick Reference Guide: Institute of Geodesy University of Stuttgart

This document provides a quick reference guide for commonly used Matlab functions. It lists and describes standard mathematical functions, matrix operations, statistical operators, linear algebra functions, graphics functions, and programming structures in Matlab.

Uploaded by

Diwas Poudel
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Institute of Geodesy University of Stuttgart

Matlab Quick Reference Guide

General Standard Functions (element-wise)

help help function cos, sin, trigonometric functions (radian)


demo, intro demo and intro to Matlab tan
whos, what info on variables or files cosd, sind, likewise (degree)
pwd, cd create, change directory tand
size, length size and length of matrices acos, asin, inverse trigonometric functions (ra-
tic, toc determine computation time atan, atan2 dian)
clear all clear all workspace variables acosd, likewise (degree)
clearvars likewise, except . . . asind, atand
-except ... exp, log power of e, natural logarithm
clc clear command window log10 base 10 logarithm
format set output number format, e. g. sqrt, square root
format long g realsqrt
addpath adds programs or data in another nthroot nth root
folder so that Matlab can find them round, fix, rounding commands
ceil, floor
abs, sign absolute value, sign
Symbols

% helptext, comment Matrices


[ ... ] matrix definition or output arguments
( ... ) priority or input arguments ones, zeros create matrices filled with 1 or 0
= assignment eye unit matrix
: indexing and vector definition, forc- magic magical square
ing/converting to a standing vector rand, randn random numbers (uniform/normal)
; no output in main window diag diagonal matrix creation/extraction
’ ... ’ define a text string fliplr, horizontal or vertical mirroring
flipud
rot90 rotate matrix 90 degrees
Operators meshgrid create grid

+, - add and subtract


*, /, ˆ matrix wise multiplication, division, Statistical Operators (columnwise)
exponentiation
.*, ./, .ˆ elementwise operations sum, cumsum sum and cumulative sum
diff difference between subsequent ele-
ments
Relational Operators mean, std mean, standard deviation
min, max minimum, maximum
>, >= larger than, larger or equal sort sorting
<, <= smaller than, smaller or equal
==, ~= equal to, not equal to
&, |, ~ logical and, or, not Linear Algebra (matrixwise)

inv invert
Predefined Numbers eig eigenvalue decomposition
chol Cholesky decomposition
pi π det, trace determinant, trace
inf ∞, e. g. 1/0 rank rank of a matrix
nan not a number, e. g. 0/0 ’ transpose
1i imaginary unit \ solver for linear systems of equations
eps floating point accuracy

–1–
Institute of Geodesy University of Stuttgart

Graphics Programming Structures

figure opens a new figure window function function m-file header


close all closes all open figures [...] =
plot, plot3 curve plot 2D, 3D name(...,
polar polar coordinate plot ...)
semilogy semi-log scale plot return exit a function
loglog log-log scale plot nargin, number of input/output arguments
plotyy y-tick labels on the left and right nargout
hist, bar bar diagram (e. g. histogram isempty, checks if a variable is empty, a scalar, a
pcolor matrix representation (nodes) isscalar, vector, . . .
image matrix representation (cells) isvector,
surf, mesh 3D surface is...
colormap color table if ... if-block
colorbar color bar elseif ...
axis, grid manipulate axes and grids else ... end
view rotate the view switch ... switch-block
hold on, keep/overwrite previous figure con- case ...
hold off tent otherwise
xlabel, annotation ... end
ylabel, for ... end for-loop
zlabel, while ... while-loop
title end
text, gtext positioning of text (also interactively) break exit a loop
continue continue a loop with the next turn
input keyboard input
keyboard returns to the command prompt in de-
bug mode

–2–

You might also like