% 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')