Professional Documents
Culture Documents
Sandeep Nagar
Introduction to Scilab: For Engineers and Scientists
Sandeep Nagar
New York, USA
v
Table of Contents
vi
Table of Contents
vii
Table of Contents
Chapter 4: Plotting������������������������������������������������������������������������������93
4.1 Introduction���������������������������������������������������������������������������������������������������93
4.2 2D Plotting����������������������������������������������������������������������������������������������������93
4.2.1 plot(x,y)�������������������������������������������������������������������������������������������������93
4.2.2 plot2d(), plot2d2(), plot2d3(), and plot2d4()������������������������������������������97
4.2.3 polarplot()�������������������������������������������������������������������������������������������100
4.3 Special Plots�����������������������������������������������������������������������������������������������103
4.3.1 Histograms�����������������������������������������������������������������������������������������103
4.3.2 matplot�����������������������������������������������������������������������������������������������105
4.3.3 grayplot����������������������������������������������������������������������������������������������106
4.3.4 champ�������������������������������������������������������������������������������������������������108
4.3.5 Contour Maps�������������������������������������������������������������������������������������111
4.4 2D Animation�����������������������������������������������������������������������������������������������115
4.4.1 comet�������������������������������������������������������������������������������������������������115
4.4.2 paramfplot2d()������������������������������������������������������������������������������������116
4.5 Plotting Multiple Plots in the Same Graph��������������������������������������������������117
4.5.1 Plotting Multiple Plots Separately������������������������������������������������������119
viii
Table of Contents
ix
Table of Contents
Chapter 8: XCOS��������������������������������������������������������������������������������167
8.1 Introduction�������������������������������������������������������������������������������������������������167
8.2 Installing XCOS��������������������������������������������������������������������������������������������168
8.3 Launching XCOS������������������������������������������������������������������������������������������168
8.3.1 Using a Command Line�����������������������������������������������������������������������169
8.3.2 Using a Graphical Symbol�������������������������������������������������������������������169
8.3.3 From the Menu Bar�����������������������������������������������������������������������������170
8.4 XCOS Palettes���������������������������������������������������������������������������������������������170
8.5 XCOS Editor�������������������������������������������������������������������������������������������������172
8.6 XCOS Menu Bar�������������������������������������������������������������������������������������������177
8.7 Reconstructing the Bouncing Balls Example from Scratch�������������������������183
8.8 Making Simulations Using XCOS�����������������������������������������������������������������188
8.9 Summary����������������������������������������������������������������������������������������������������189
Index�������������������������������������������������������������������������������������������������191
x
About the Author
Sandeep Nagar, PhD (Material Science,
KTH Royal Institute of Technology, Sweden),
teaches and consults on the use of Scilab
and other open source software for data
science and analysis. In addition to teaching
at universities, he frequently gives workshops
on open source software and is interested
in developing hardware for scientific
experiments.
xi
About the Technical Reviewer
Massimo Nardone has more than 22 years
of experiences in security, web and mobile
development, cloud computing, and IT
architecture. His true IT passions are security
and Android.
He has been programming and teaching
how to program with Android, Perl, PHP, Java,
VB, Python, C/C++, and MySQL for more than
20 years.
He holds a Master of Science degree in
computing science from the University of Salerno, Italy.
He has worked as a project manager, software engineer, research
engineer, chief security architect, information security manager,
PCI/SCADA auditor, and senior lead IT security/cloud/SCADA architect
for many years.
Massimo's technical skills include security, Android, cloud, Java,
MySQL, Drupal, Cobol, Perl, web and mobile development, MongoDB, D3,
Joomla, Couchbase, C/C++, WebGL, Python, Pro Rails, Django CMS, Jekyll,
and Scratch.
He currently works as the chief information security officer (CISO) for
Cargotec Oyj.
He has worked as a visiting lecturer and supervisor for exercises at the
Networking Laboratory of the Helsinki University of Technology (Aalto
University). He holds four international patents (PKI, SIP, SAML, and Proxy
areas).
Massimo has reviewed more than 40 IT books for different publishing
companies and he is the co-author of Pro Android Games (Apress, 2015).
xiii
Acknowledgments
I wish to thank Steve, Mark, and the whole team at Apress for bringing out
this book in such a nice format. I also wish to thank the Scilab community
for answering questions on forums, which helped me learn difficult
concepts with ease.
xv