Introduction to Scilab by Sandeep Nagar

Introduction to Scilab by Sandeep Nagar

Author:Sandeep Nagar
Language: eng
Format: epub
Publisher: Apress, Berkeley, CA


3.8.2 Cross Products

The built-in function cross() returns the cross product of two input vectors:

1 −−>a=[1 2 3];

2 −−>b=[2 3 4];

3 −−>cross(a,b)

4 ans =

5 − 1. 2. −1.

6 −−>a1=[%t,%t,%f];

7 // One can def ine vector using booleans too

8 −−>a2=[%f,%f,%f];

9 −−>cross(a1,a2)

10 ans =

11 0. 0. 0.

12 −−>cross(a1,a) // cross product of boolean vector with vector of real numbers

13 ans =

14 3. − 3. 1.

3.9 Discrete Mathematics

Scilab has a limited but useful set of built-in functions to work with discrete mathematics as follows:1. primes outputs the primes numbers until the given number

1 −−>x = 30;

2 −−>y = primes(x)

3 y =

4 2. 3. 5. 7. 11. 13. 17. 19. 23. 29.

5



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.