⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rhl35.htm

📁 linux的初学电子书
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<HTML>

<HEAD>

<TITLE>Red Hat Linux Unleashed rhl35.htm </TITLE>

<LINK REL="ToC" HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm">

<LINK REL="Index" HREF="htindex.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/htindex.htm">

<LINK REL="Next" HREF="rhl36.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl36.htm">

<LINK REL="Previous" HREF="rhl34.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl34.htm"></HEAD>

<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">

<A NAME="I0"></A>

<H2>Red Hat Linux Unleashed rhl35.htm</H2>

<P ALIGN=LEFT>

<A HREF="rhl34.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl34.htm" TARGET="_self"><IMG SRC="purprev.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purprev.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Previous Page"></A>

<A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/index.htm" TARGET="_self"><IMG SRC="purtoc.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purtoc.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="TOC"></A>

<A HREF="rhl36.htm" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/rhl36.htm" TARGET="_self"><IMG SRC="purnext.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/purnext.gif" WIDTH = 32 HEIGHT = 32 BORDER = 0 ALT="Next Page"></A>


<HR ALIGN=CENTER>

<P>

<UL>

<UL>

<UL>

<LI>

<A HREF="#E68E308" >Scilab</A>

<UL>

<LI>

<A HREF="#E69E407" >How To Get and Install Scilab</A>

<UL>

<LI>

<A HREF="#E70E10" >Running Scilab</A></UL>

<LI>

<A HREF="#E69E408" >More Information on Scilab</A></UL>

<LI>

<A HREF="#E68E309" >Pari</A>

<UL>

<LI>

<A HREF="#E69E409" >Where To Get Pari</A>

<LI>

<A HREF="#E69E410" >Running Pari</A></UL>

<LI>

<A HREF="#E68E310" >Using LISP-STAT</A>

<UL>

<LI>

<A HREF="#E69E411" >Where To Get LISP-STAT</A>

<LI>

<A HREF="#E69E412" >Running xlispstat</A></UL>

<LI>

<A HREF="#E68E311" >A Last Note</A>

<LI>

<A HREF="#E68E312" >Summary</A></UL></UL></UL>

<HR ALIGN=CENTER>

<A NAME="E66E35"></A>

<H1 ALIGN=CENTER>

<CENTER>

<FONT SIZE=6 COLOR="#FF0000"><B>35</B></FONT></CENTER></H1>

<BR>

<A NAME="E67E35"></A>

<H2 ALIGN=CENTER>

<CENTER>

<FONT SIZE=6 COLOR="#FF0000"><B>Mathematics on Linux</B></FONT></CENTER></H2>

<BR>

<P>This book has dealt with many issues regarding the tools available for Linux. Now, let's look at some of the mathematics tools for Linux. Specifically, we will work with tools for doing mathematical and statistical applications under Linux. One such 
tool we will be working with is Scilab, an interactive math and graphics package. Another tool for symbolic math is Pari. For statistical operations using LISP choose LISP-STAT.

<BR>

<BR>

<A NAME="E68E308"></A>

<H3 ALIGN=CENTER>

<CENTER>

<FONT SIZE=5 COLOR="#FF0000"><B>Scilab</B></FONT></CENTER></H3>

<BR>

<P>The Scilab application was developed by the Institut National de Recherche de Informatique et en Automatique (INRIA) in France. Although this application is not as formidable as MATLAB, a commercial product with more bells and whistles, Scilab is still 
powerful enough to provide decent graphics and solutions to math problems.

<BR>

<P>With Scilab you can do matrix multiplication, plot graphs, and so on. Using its built-in functions, Scilab enables you to write your own functions. With its toolbox, you can build your own signal- processing functions in addition to those provided by 
Scilab.

<BR>

<P>Added to all its features, the help file is quite voluminous. If you want to find out how to do a math problem with Scilab, you will probably find it in the docs. Added to the good documentation are sample programs to get you started.

<BR>

<BR>

<A NAME="E69E407"></A>

<H4 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>How To Get and Install Scilab</B></FONT></CENTER></H4>

<BR>

<P>Now that you are probably interested in Scilab, you will want to know where to get it. Scilab is free via the Internet. The primary site is <A HREF="tppmsgs/msgs1.htm#105" tppabs="ftp://ftp.inria.fr/">ftp.inria.fr</A>, and the directory for this is in INRIA/Projects/Meta2/Scilab. Look 
for the zipped file with the latest date. Each zipped file is complete in itself.

<BR>

<P>The file you are looking for is called scilab-2.2-Linux-elf.tar.gz. In its unzipped form, the file is about 15MB in size. After moving scilab-2.2-Linux-elf.tar.gz to the directory you want it installed in (such as /usr/local), untar by typing gunzip 
scilab-2.2-Linux-elf.tar.gz | tar xvf-.

<BR>

<P>After you have installed it (into the /usr/local/scilab-2.2 directory), go to the /usr/local/scilab-2.2/bin subdirectory and modify the scilab shell script file. Replace the assignment of the SCI variable with the path to the location of your scilab 
files. For example, in my case I set the value to

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">SCI=&quot;/home/khusain/scilab-2.1.1&quot;</FONT></PRE>

<BLOCKQUOTE>

<BLOCKQUOTE>

<HR ALIGN=CENTER>

<BR>

<NOTE>If Scilab does not show up in color the first time you invoke it, try *customization: -color in your .Xdefaults file. Don't forget to run xrdb .Xdefaults to enforce the change.</NOTE>

<BR>

<HR ALIGN=CENTER>

</BLOCKQUOTE></BLOCKQUOTE>

<BR>

<A NAME="E70E10"></A>

<H5 ALIGN=CENTER>

<CENTER>

<FONT SIZE=4 COLOR="#FF0000"><B>Running Scilab</B></FONT></CENTER></H5>

<BR>

<P>To invoke scilab, type scilab in an Xterm window while in the /usr/local/scilab-2.2/bin directory.

<BR>

<P>The prompt for Scilab is &#151;&gt;. You will see responses to your commands immediately below where you type in entries.

<BR>

<P>A healthy example of how to use Scilab would probably be beneficial. Let's see how to declare values:

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">&#151;&gt;x=1.0</FONT></PRE>

<P>This sets x equal to 1.0. To declare an array, use square brackets:

<BR>

<PRE>

<FONT COLOR="#000080">&#151;&gt;x=[1 2 3]

x =

! 1. 2. 3. !</FONT></PRE>

<P>See Figure 35.1 to see what it looks like on your screen.

<BR>

<P><B> <A HREF="35rhl01.gif" tppabs="http://202.113.16.101/%7eeb%7e/Red%20Hat%20Linux%20Unleashed/35rhl01.gif">Figure 35.1. Main screen for Scilab.</A></B>

<BR>

<P>To declare a large array you can use indices of the form [start:end]. Use a semicolon at the end of the line to indicate that you really do not want Scilab to echo the results back to you. So, the following statement

<BR>

<BR>

<PRE>

<FONT COLOR="#000080">&#151;&gt;x=[1:100];</FONT></PRE>

<P>declares x as a vector of values from 1 to 100 and does not display the contents of x back to you. If you want to give staggered values of x, you can use an increment operator in the form [start:increment:stop]. So, this statement declares x to contain 
five odd numbers from 1:

<BR>

<PRE>

<FONT COLOR="#000080">&#151;&gt;x=[1:2:10]

x =

! 1. 3. 5. 7. 9. !</FONT></PRE>

<P>Let's try an example of a simple matrix multiplication problem of ax=b. First declare the a matrix, separating all the rows with semicolons. If you do not use semicolons, the values in matrix a will be interpreted as a 25&#180;1 vector instead of a 
5&#180;5 matrix.

<BR>

<PRE>

<FONT COLOR="#000080">&#151;&gt;a=[ 1 1 0 0 0; 1 1 1 0 0; 0 1 1 1 0; 0 0 1 1 1; 0 0 0 1 1]

a =

! 1. 1. 0. 0. 0. !

! 1. 1. 1. 0. 0. !

! 0. 1. 1. 1. 0. !

! 0. 0. 1. 1. 1. !

! 0. 0. 0. 1. 1. !</FONT></PRE>

<P>Then declare X as a vector.

<BR>

<PRE>

<FONT COLOR="#000080">&#151;&gt;X=[ 1 3 5 7 9 ]

X =

! 1. 3. 5. 7. 9. !</FONT></PRE>

<P>To get the dimensions right for the multiplication, you have to use the single quotes ():Scilab multiplication;single quote operator () to get the transpose of X. Then put the results of the multiplication of a and X transpose into b.

<BR>

<PRE>

<FONT COLOR="#000080">&#151;&gt;b= a * X'

b =

! 4. !

! 9. !

! 15. !

! 21. !

! 16. !

&#151;&gt;</FONT></PRE>

<P>The results look right. In fact, Scilab displayed the dimensions correctly too, since the results of the multiplication are a matrix of size 5&#180;1.

<BR>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -