-
16
pages
-
English
-
Documents
Description
1 Getting Started1. Go to a workstation in room 249 in Research I2. Log in using your new account name and password3. Open a terminal using the mouse following the instructions given in class.4. Type the command passwd5. Enter your new password - make sure it is at least 6 characters with on number and onepunctuation mark. Make sure to remember this for the whole semester!6. Type the command octave7. Open a web browser, and go to the class web site.8. Follow the rest of the instructions in the tutorial.12 BasicsType in the following# a comment - not processed by octave# simple math2+ 3# a sine function and cosinesin(3)cos(3)# defining variablex = 3# using a variable in a functioncos(x)# evalute a function into a variabley = cos(x)# not printing the result outy = cos(x);Use octave to answer the following questions31. What is e ?2. Set x= 2.22(a) what is cos (x)+sin (x)?(b) What is tan(x)?(c) What is the natural log of x?(d) What is the log (base 10) of x?23 Basic ArraysType in the following# setting up a one dimensional array of values - a vectorx = [0,0.3,0.8,1.5,2,2.4,3,4,5,5.8,7.1]# function of a vector - creates a new vectory = cos(x)# plotting a single vectorplot(y)# plotting two vectorsplot(x,y)# plotting with a symbolplot(x,y,"*")# plotting with symbols and linesplot(x,y,"*-")#setting up a random 2d arrayrand(3,4)# 3d random arrayrand(3,4,2)Do the following exercises-1. Plot sin(x) using the x vector above.2. ...
-
Publié par
-
Langue
English