summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChayan Bhawal2018-09-27 21:08:17 +0530
committerChayan Bhawal2018-09-27 21:08:17 +0530
commit032dc034194100cb3428d073efd0a8ed05c3accd (patch)
treed5b675cb44a4085d95121dccfd92b7ba50bc13ab
parenta58151ad625782ff6bb5c45db686912e4cd84e1d (diff)
downloadscilab-tutorials-032dc034194100cb3428d073efd0a8ed05c3accd.tar.gz
scilab-tutorials-032dc034194100cb3428d073efd0a8ed05c3accd.tar.bz2
scilab-tutorials-032dc034194100cb3428d073efd0a8ed05c3accd.zip
Updating Plot folder
-rw-r--r--Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce4
-rw-r--r--Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce6
-rw-r--r--Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce13
-rw-r--r--Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce2
-rw-r--r--Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce16
5 files changed, 29 insertions, 12 deletions
diff --git a/Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce b/Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce
index 070290c..833855b 100644
--- a/Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce
+++ b/Tutorial2_Plot/Scilab_code/Tutorial2_semilog.sce
@@ -3,7 +3,7 @@ clear
clc
//Import data from file
-Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2/Data/Tut2_data1.csv');
+Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2_Plot/Data/Tut2_data1.csv');
//Segregate the data into variables
y = Data(:,1);
@@ -13,7 +13,7 @@ x = [Data(:,4) Data(:,5)]
//Figure 1 is a semilog plot
fig1 = figure();
plot2d(y,x,[1,2],logflag="nl")
-legends(['Length of x1','Length of x3'],[1,2],opt="ur",font_size=1,font);
+legends(['Length of x1','Length of x3'],[1,2],opt="ur",font_size=1);
//Figure 2 is a loglog plot
diff --git a/Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce b/Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce
index 91e4f20..e149334 100644
--- a/Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce
+++ b/Tutorial2_Plot/Scilab_code/Tutotial2_multi_plotting.sce
@@ -3,7 +3,7 @@ clear
clc
//Import data from file
-Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2/Data/Tut2_data1.csv');
+Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2_Plot/Data/Tut2_data1.csv');
//Segregate the data into variables
y = Data(:,1);
@@ -33,3 +33,7 @@ xtitle('Plot of Time versus Length_x1 and Length_x3','Time','Length');
legends(['Length of x1','Length of x3'],[-1,2],opt="ur",font_size=2); //Font size of the legends
+
+
+
+
diff --git a/Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce b/Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce
index 1cf2566..20a8427 100644
--- a/Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce
+++ b/Tutorial2_Plot/Scilab_code/Tutotial2_plot_save.sce
@@ -3,18 +3,19 @@ clear
clc
//Import data from file
-Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2/Data/Tut2_data1.csv');
+Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2_Plot/Data/Tut2_data1.csv');
//Segregate the data into variables
y = Data(:,1);
x1 = Data(:,2)
-//Figure 1 is y versus x1
-fig1 = figure();
-plot(y,x1);
+//Figure 1 is y versus x1 with linewidth = 3
+//fig1 = figure();
+fig1 = scf(1);
+plot(y,x1,'Linewidth',3);
//Export Figure 1 as svg file
-xs2svg(fig1,'plot_y_versus_x1')
+xs2svg(fig1,'plot_y_versus_x1');
//Export Figure 2 as pdf file
-xs2pdf(fig1,'plot_y_versus_x1')
+xs2pdf(fig1,'plot_y_versus_x1');
diff --git a/Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce b/Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce
index b191b80..f16018c 100644
--- a/Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce
+++ b/Tutorial2_Plot/Scilab_code/Tutotial2_plotting.sce
@@ -3,7 +3,7 @@ clear
clc
//Import data from file
-Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2/Data/Tut2_data1.csv');
+Data = csvRead('/home/chayan/Documents/scilab-tutorials/Tutorial2_Plot/Data/Tut2_data1.csv');
//Segregate the data into variables
y = Data(:,1);
diff --git a/Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce b/Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce
index 6ab3a23..6d38c84 100644
--- a/Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce
+++ b/Tutorial5_Nonlinear_equation/Scilab_code/Tutotial5_nonlinear_equation.sce
@@ -10,10 +10,22 @@ function y = nonlinear_func(x)
endfunction
-//Initial guess for the solution
+//Initial guess for the solution
x0 = 0;
//Computation of solution using fsolve
y_result = fsolve(x0,nonlinear_func);
-
+//Display the solution in command window
disp(y_result,'Solution of the equation')
+
+
+//Plot of cos(x)*sin(x) and tan(x)-1 to check validity of the solution of fsolve
+//To create data-points for computation of the functions cos(x)*sin(x) and tan(x)-1
+t = linspace(-201,-200);
+z1 = cos(t).*sin(t);
+z2 = tan(t)-1*ones(length(t));
+
+//To plot t versus cos(t)*sin(t) and tan(t)-1
+plot2d(t,[z1' z2'])
+
+