I am using Octave but I think it applies to MatLab too, so I'm tagging this MatLab since there isnt a Octave tag
When I do
x=linspace(-5,5,25)
y=1/xI get
error: operator /: nonconformant arguments (op1 is 1x1, op2 is 1x25)
Or
x=linspace(-5,5,25)
y=x^2I get
error: for A^b, A must be square
How can I then plot the graphs of each?
$\endgroup$1 Answer
$\begingroup$Try:
x=linspace(-5,5,25)
y = 1./x
plot(x,y)
x=linspace(-5,5,25)
y=x.^2
figure
plot(x,y) $\endgroup$