MATLAB: Trying to plot function

plot

I have the function y = (x+2)^2/(3x+1) over the range 1=<x=<2 and when I graph it the plot stops at 1 on the x axis so when I put in the range into the data bounds it doesn't show up. I'm not sure if I'm typing the function out wrong or what I'm doing.
here is what I have:
clc;
x = linspace(0,1,100);
y = (x+2)^2./(3*x+1);
plot(x,y);
I've tried different values for the linspace, putting a "." before the ^2
Any help would be appreciated

Best Answer

x = linspace(0,1,100);
y = (x+2).^2./(3*x+1);
plot(x,y);
REad about element by element operation...use .^ instead of ^.