Using MATLAB at BU in MA 226
Paul Blanchard

One way to make pictures of slope fields, vector fields, and phase portraits is by using MATLAB and Professor John Polking's MATLAB routines dfield and pplane.

There are a number of ways that you can access MATLAB here at BU:

Getting started on ACS: After you log into the ACS cluster, I recommend that you make a subdirectory of your home directory for MA 226. Here's what you do (follow each line with a return):

   cd
   mkdir 226
   cd 226
   cp ~paul/226/polking6.0/* .
   ls
At this point, you should have at least 13 MATLAB .m (dot m) files in your 226 directory. Be careful about the space between the star and the dot in the cp command above. You should only need to copy these files once. I may distribute other .m files as the semester progresses, and you will have to copy those to your 226 directory. But you should be able to get started now.

Using dfield6 or pplane6 on ACS: Here are the steps that you need to follow to use dfield6 or pplane6 on a regular basis:

   cd
   cd 226
   matlab
These commands should produce a MATLAB session. When I did this, here's what happened:
acsn03 [paul] 22) matlab

matlab now invokes version 6.0--use matlab53 to invoke former version, 5.3.

Use matlabdoc to get Matlab help & documentation.

                               < M A T L A B >
                   Copyright 1984-2000 The MathWorks, Inc.
                         Version 6.0.0.88 Release 12
                                 Sep 21 2000

 
  To get started, type one of these: helpwin, helpdesk, or demo.
  For product information, visit www.mathworks.com.
 
>>

Your UNIX prompt may look different, but that's not important. The double greater-than signs (>>) are the MATLAB prompt. Type either
dfield6
or
pplane6
at the MATLAB prompt. If you are running MATLAB in the X windows environment (see above), you should get what you want. If you are not in the correct environment, eventually you'll get the >> prompt back, but you won't get dfield or pplane. Here's a sequence of MATLAB commands that will confirm this for you:
   x = 0:0.1:2*pi;
   y = sin(x);
   plot(x,y)
If you don't get a window with the graph of one period of the sine function in it, then you're not in the X windows environment. Get one of your friends who knows a little about X windows to help you or try the help desk in the basement of 111 Cummington St. There is on-line help for ACS at http://www.bu.edu/computing/acs/help.

Personal computers or UNIX networks other than ACS: Much of what I have described above applies to other computers as well. But you will have to transfer the .m files from ACS to the computer or network at hand. Transfering files is best done with an "ftp" program (file transfer program). If you don't know how to use an ftp program, then you'll need help from someone. I am always glad to help get you started if you come by my office hours.

Last revision: January 19, 2003