We have moved to @ Placement Papers Hub !! Visit our new website here for more..

Making Non-Choppy and Smooth Plot of the functions, f(x) = sin(1/x) for 0.01< x < 0.1 and g(x) = (sin x) /x.


Making Non-Choppy and Smooth Plot of the functions, f(x) = sin(1/x) for 0.01< x < 0.1 and g(x) = (sin x) /x.


>> x=linspace(0.01,0.1,30);
>> y=sin(1./x);                                                                                                                                                                                                                                                                                                    
>> plot(x,y)
















>> x=linspace(0.01,0.1,30);
>> z=(sin(x))./x;
>> plot(x,z)

















smooth(x,y)

ans =

   -0.5064
   -0.2055
    0.1948
    0.4954
    0.2620
    0.4639
    0.1793
    0.2495
   -0.0881
   -0.1369
   -0.0113
    0.2433
    0.0269
   -0.0188
   -0.0693
   -0.2609
   -0.3304
   -0.1155
    0.2615
    0.5699
    0.6562
    0.5011
    0.1808
   -0.1949
   -0.5291
   -0.7596
   -0.8608
   -0.8362
   -0.7564
   -0.5440


>> smooth(x,z)

ans =

    1.0000
    1.0000
    1.0000
    0.9999
    0.9999
    0.9999
    0.9999
    0.9998
    0.9998
    0.9998
    0.9997
    0.9997
    0.9996
    0.9996
    0.9995
    0.9995
    0.9994
    0.9993
    0.9993
    0.9992
    0.9991
    0.9991
    0.9990
    0.9989
    0.9988
    0.9987
    0.9986
    0.9985
    0.9984
    0.9983