0

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.

6
  • Is the python tag relevant here? Commented Apr 19, 2021 at 21:40
  • 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? Commented Apr 19, 2021 at 21:41
  • Scilab uses python, as I know Commented Apr 19, 2021 at 21:41
  • 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 Commented Apr 19, 2021 at 21:43
  • 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 Commented Apr 19, 2021 at 21:43

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, you're a lifesaver!
Don't hesitate to ask further questions about Scilab !

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.