Hi tried giving it another name and got a massive string of errors:

Input:

%Compute Distance from Origin of Parent Parabola

clear

x=-2:0.01:4;

Dist=dog(x);

disp('Distance From Origin is')

disp('Dist')

%Plot values between -1 and 4 Showing Distance

xvec=(-2:0.01:4);

Dvec=dog(xvec);

plot(xvec,Dvec)

xlabel('x Points')

ylabel('Dist From Origin')

title('Graph Showing Distance from Origin of Parent Function'

Function file dog.m

function D=dog(x)

%Compute distance from origin for given parent parabola

D=sqrt(x.^2+(x.^2-2*x-4).^2);

Errors:

>> untitled6

Distance From Origin is

Dist

Undefined operator '.^' for input arguments of type

'matlab.graphics.axis.Axes'.

Error in length (line 3)

D=sqrt(x.^2+(x.^2-2*x-4).^2);

Error in cla (line 19)

if nargin>0 && length(varargin{1})==1 &&

ishghandle(varargin{1}) &&

strcmpi((get(varargin{1},'Type')),'axes')

Error in newplot>ObserveAxesNextPlot (line 124)

cla(ax, 'reset',hsave);

Error in newplot (line 73)

ax = ObserveAxesNextPlot(ax, hsave);

Error in untitled6 (line 10)

plot(xvec,Dvec)