0
votes

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.

1
Is the python tag relevant here? - Pranav Hosangadi
You need to figure out the function y = f(x) that allows you to calculate y from the given x. Why do you expect to get that output when your y values are either -1 or 1? - Pranav Hosangadi
Scilab uses python, as I know - Rim
But your question is about plotting it using scilab, isn't it? Presumably scilab also uses Windows, but you wouldn't tag your question windows - Pranav Hosangadi
I'm sorry, the code have no relation to main task, I just previously tried to remake that code to complete my task, but met problems doing this - Rim

1 Answers

1
votes

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