chapter 12 Flashcards
(41 cards)
rectangular data grids
regularly spaced rectangular data set where values are coordinates, element number as x val and value as y val
mesh grid format
elements in each column of 2D x-array are all identical and elements in each row in 2D y-array are identical
[xmesh, ymesh] = meshgrid(xVals, yVals)
replicated 1D array xvals and ovals to make data grid with output coordinate arrays
[xndGrid, yndGrid] = ndgrid(xVals, yVals)
replicates 1D arrays, ovals and y vals, to make data grid and transpose values
dimensions of a grid
length(xVals) x length(yVals)
surf(x, y, z)
makes surface plot
(z = color data, x & y are 1D/2D arrays for coordinates)
surfc(x, y, z)
makes surface plot with contour lines
mesh(x, y, z)
wire frame mesh
meshc(x, y, z)
plots mesh with contour
meshz(x,y,z)
plots curtain around mesh
waterfall(x, y, z)
draws mesh similar to mesh but no lines from columns
surfl(x, y,z)
plots surface plot with color map based on lighting
shading(x, y, z)
sets color shading properties
triplot(x, y, z)
triangle plot
trimes(x, y, z)
triangle as mesh
trisurf(x, y, z)
triangle as surface
true or false, the size of a plot can change between iterations
false
hold on;
displays additional points
anonymous function
custom function defined directly in workspace and not stored in separate program
anonymous function example
myFct = @(x)x+14
@ creates function handle
x is input
x + 14 is statement executed by function
recursive function
function that calls itself using branches in computing
symbolic variables
represent unknown numeric var like x
create sym vars
sym(‘x’) or syms x
sym(num, flag)
converts num to output specified by flag (num of floating)