Search code examples
plotscilab

Scilab function plotting


I really need to build this graphic from code written in scilab. I know it's may seems easy, but I'm new to this I don't know tools to do this or just simply can't understand.

graph Currently I have this code

clf();
// ..a macro:
deff('[y]=toto(x)','y=x.*x')
plot(1:100,toto)

Resulting in next: enter image description here

I will be very thankful, if you help me with code or at least have any suggestions.


Solution

  • Here is an example:

    x1=linspace(0,.5,100);
    x2=linspace(0.5,1,100);
    y1=x1.^2;
    y2=x2.^2-.5;
    plot([x1 x2],[y1 y2])
    

    enter image description here