Search code examples
scilab

Transposing row vector X to get compatible dimensions warning in Scilab


I am learning to use Scilab, I tried plotting a function which I know have a discontinuity at a certain value but the plot I got had a non expectable behavior so I tried to plot a very well known function "y=1/x".

I created the "x" vector

x=[-10:1:10];

Then created the "y" function

y=1/x;

And then used the plot command

plot(x,y)

I got the following warning

WARNING: Transposing row vector X to get compatible dimensions

And my plot is a straight line, I don't know what I'm doing wrong.


Solution

  • Take care: 1/x compute some thing like 1*pinv(x) not the array [1/x(1),1/x(2),...]. to obtain the previous result use 1 ./x for element wise disvision.