`=11

Once only adjustments to your set-up on W2K

Please do the following.

  1. Create a Command Prompt window by doing the following.
    Start --> MS-DOS Command Prompt
    
    
    You can also get this by using
    Start --> Run
    
    
    and entering cmd.exe.
  2. In the command window just created type the following
    net use r: \\charon.brunel.ac.uk\$mastaff
    
    
    You need to type this exactly as given (note the space after the : character). You will be prompted for a password. Assuming that you correctly enter your password a network drive labelled as r: will be mounted. If for some reason this fails then you can try typing instead
    net use r: \\134.83.6.7\$mastaff
    
    
  3. In the command window type the following
    net use u: \\pinn.brunel.ac.uk\ma02xyz /user:ma02xyz
    
    
    with ma02xyz replaced by your login id.. As in * you will be prompted for a password. Assuming that this is all done correctly you will create a drive labelled as u: which contains the files you used last year. pinn is currently the server used for ma02 logins on the unix network.
  4. In the command window type the following
    call r:\lab\mike\w2k\mkwsetup.bat
    
    
    This will create a directory (folder) called h:\mybin and it will copy a few batch files to this directory.
  5. We recommend that you create a directory (folder) for your MATLAB sessions. Hence type the following.
    mkdir h:\ma2915
    
    
  6. As a check for us that you have successfully done this please type the following.
    h:\mybin\listfiles.bat
    
    
    This will create the file with the name u:\hdrfiles containing a list of your files in the directories h:\mybin and h:\ma2915. We ask you to email this file to us in the UNIX instructions given below.

Remarks about subsequent sessions

On subsequent logins you will be prompted for your password to connect the r: and u: drive but you will not need to type the net use commands again unless you lose your settings. You will only need to create a command window as described in * and to type
h:\mybin\p

to set the path properly.

Once only adjustments to your set-up on UNIX

You can connect to unix by using the program putty. You can do this by using the menus or by simply creating a command window and typing

putty molnir

At the prompt on molnir you need to type, exactly as given, the two commands

source ~icstmkw/bin/ma2915startup
source $HOME/.mkwaaa

To email the file hdrfiles to complete the check that you have completed the above please type the following at the unix command prompt.
mail mastpmd icstmkw -s firstsession < $HOME/hdrfiles

Matlab tasks

  1. Start Matlab by typing the following in a command window.
    h:
    cd h:\ma2915
    ma
    
    
    This will change to your ma2915 directory and then start Matlab. To start Matlab you can alternatively select Run from the start menu and type
    l:\cc\matlab61\bin\win32\matlab.exe
    
    
    Observe that your current working directory is displayed in a bar at the top of the Matlab window.
  2. Start the built-in Matlab editor. You can do this by selecting File from the top bar and then selecting open or by typing edit at the the Matlab prompt of >> in the Command Window.
  3. Then in the editor window create the following function file which has only 2 lines.
    function y=testfn1(x)
    y=sin(x)+sin(3*x)/3+sin(5*x)/5+sin(7*x)/7;
    
    
    Save the file as testfn1.m. ( Matlab will suggest this as the name because of your first line in the function).
  4. In the editor window click on File on the top bar and select New and then select M-file. In the edit window that this gives you create the following script file
    x=linspace(0,3*pi,300);
    y=testfn1(x);
    figure(1)
    plot(x,y)
    
    
    Save this file with the name test1.m. (Note that on the bottom bar of the editor you will see the names of all the *.m files currently open and thus you can easily change between modifying your current file and modifying any of the files shown.)
  5. To test the set of instructions then type the following at the command prompt of >>.
    test1
    
    
  6. You will need to use for loops many times in this module. To attempt to find out how this works create the following test script and test it.
    for k=1:5
    fprintf('k=%d, %d %d\n',k,k^2,k^3);
    end
    
    
  7. Similarly also create and test the following script.
    s=0;
    for k=1:1000
      s=s+1/k;
    end
    
    
    What does the final value of s give you?
  8. With n > 0, a < b, h=(b-a)/n and equally spaced points xk=a+kh, k=0,1,¼,n the composite Trapezium rule approximation to
    ó
    õ
    b

    a 
    f(x) dx
    is given by
    In=  h

    2
    æ
    è
    f(a)+f(b)+2 n-1
    å
    k=1 
    f(xk) ö
    ø
    .
    Create a function file called trapez1.m with a first line of the form
    function approx=trapez1(a,b,n)
    
    
    to compute this composite trapezium rule approximation. Test the function file with the function
    f(x)=sinx
    and with a=0 and b=p and with n=4, n=8, n=16 and n=32.



File translated from TEX by TTH, version 3.00.
On 19 Nov 2003, 13:19.