User Tools

Site Tools


gibson:teaching:spring-2016:math445:lecture:graphics3d

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== Math 445 lecture 16: 3D graphics ====== ==== 1d graphs ==== How would you make a graph of $f(x) = (x-1)^2$ on $-3 \leq x \leq 3$ in Matlab? You would - Create vector ''x'' of gridpoints with ''linspace'' - Evaluate $f(x)$ on gridpoints using dot operations - Use ''plot(x,f)'' to draw the graph For example, <file matlab plot1d.m> % Plot 1d graph of f(x) = (x-1)^2 on -3 < x < 3 x = linspace(-3, 3, 100); % create vector x of gridpoints f = (x-1).^2; % evaluate f(x) on gridpoints plot(x,f) % plot the graph xlabel('x') ylabel('f(x) = (x-1)^2') </file>

gibson/teaching/spring-2016/math445/lecture/graphics3d.1459265276.txt.gz · Last modified: 2016/03/29 08:27 by gibson