`=11
Please do the following.
Start --> MS-DOS Command PromptYou can also get this by using
Start --> Runand entering cmd.exe.
net use r: \\charon.brunel.ac.uk\$mastaffYou 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
net use u: \\pinn.brunel.ac.uk\ma02xyz /user:ma02xyzwith 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.
call r:\lab\mike\w2k\mkwsetup.batThis will create a directory (folder) called h:\mybin and it will copy a few batch files to this directory.
mkdir h:\ma2915
h:\mybin\listfiles.batThis 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.
h:\mybin\pto set the path properly.
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/.mkwaaaTo 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
h: cd h:\ma2915 maThis 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.exeObserve that your current working directory is displayed in a bar at the top of the Matlab window.
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).
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.)
test1
for k=1:5 fprintf('k=%d, %d %d\n',k,k^2,k^3); end
s=0; for k=1:1000 s=s+1/k; endWhat does the final value of s give you?
|
|
function approx=trapez1(a,b,n)to compute this composite trapezium rule approximation. Test the function file with the function
|