[Scilab-users] simple plot function

classic Classic list List threaded Threaded
5 messages Options
Luciano Andino Luciano Andino
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] simple plot function

Hi, doing a simple plot of
Imágenes integradas 2
x in [0,1]


    x=0:0.1:1;   
    y=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9)/(21*x+6))-3.0;
    plot(x,y)

graphic differs from this online calc:

https://www.desmos.com/calculator/jehn17mvvb



Don't know what I am doing wrong,

thanks in advance


--
Luciano Andino
Ing. en Sistemas de Información
UTN FRSF
BMSTU



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Pierre Vuillemin Pierre Vuillemin
Reply | Threaded
Open this post in threaded view
|

Re: simple plot function

Hi,

A dot is missing in the argument of the hyperbolic sin for the division to be performed element-wise,


    x=0:0.1:1;   
    y=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9) ./ (21*x+6))-3.0;
    plot(x,y)

Regards,

Pierre

Le 27.03.2017 13:39, Luciano Andino a écrit :

Hi, doing a simple plot of
 
Imágenes integradas 2
x in [0,1]


    x=0:0.1:1;   
    y=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9)/(21*x+6))-3.0;
    plot(x,y)

graphic differs from this online calc:

https://www.desmos.com/calculator/jehn17mvvb



Don't know what I am doing wrong,

thanks in advance


--
Luciano Andino
Ing. en Sistemas de Información
UTN FRSF
BMSTU


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Alain LAMY Alain LAMY
Reply | Threaded
Open this post in threaded view
|

Re: simple plot function

In reply to this post by Luciano Andino

Hello,  

It’s just because a “.” was missing.

Alain

x=0:0.05:1;   
y=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9) ./ (21*x+6))-3.0;
plot(x,y)


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Luciano Andino Luciano Andino
Reply | Threaded
Open this post in threaded view
|

Re: simple plot function

Thanks Pierre and Lamy. Now I have another question:


I draw a simple function and in same pic, also draw differents points (this data in a vector)

also I want to put a label for each point "1", "2".."12"

how can I do it in scilab?, matlab's way doesn't work in my case

thanks

    x=0:0.1:1
    y=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9)./(21*x+6))-3.0;
    plot(x,y)
   
    x=info // it's a vector of 12 elements
    w=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9)./(21*x+6))-3.0;
    plot(info,w,'o')

2017-03-27 15:17 GMT+03:00 Lamy Alain <[hidden email]>:

Hello,  

It’s just because a “.” was missing.

Alain

x=0:0.05:1;   
y=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9) ./ (21*x+6))-3.0;
plot(x,y)


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users




--
Luciano Andino
Ing. en Sistemas de Información
UTN FRSF
BMSTU



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Alain LAMY Alain LAMY
Reply | Threaded
Open this post in threaded view
|

Re: simple plot function

You could use xstring or xnumb:

 

x=0:0.1:1;
y=exp((x.^4+x.^2-x+(5).^(0.5))/5)+sinh((x.^3+21*x+9)./(21*x+6))-3.0;
scf();

plot(x,y);  

 

num = 1 : size(x, "*");  

 

xnumb(x, y, num);

// or:

xstring(x, y, string(num));

 

// plus optionally:  

a = gca();

a.data_bounds = [-0.1, -0.1; 1.1, 0.75];

a.tight_limits = "on";

 

 

Alain

 


_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users