ChBE 2120 Homework 1
Due: Friday, January 14 by 5:00 PM
(Please note: most other assignments will be due at 9:00 AM on Fridays.)
The purpose of this assignment is to make sure you are familiar with some of the basics of MATLAB,
and to make sure that you can submit your homework using TSquare.
Log into your ChBE account in the computer lab (or use your computer at home with your own
installation of MATLAB or using GT’s VLAB).
Start the MATLAB program (Start menu
All Programs
MATLAB).
If you have not used MATLAB before, tutorials are available from Mathworks, here:
http://www.mathworks.com/academia/student_center/tutorials/
There is also a brief tour of MATLAB in Appendix B of Chapra and Canale, starting on p. 933.
Open an mfile.
(File
New
Mfile).
This is simply a text file that will contain your code.
It can be
a standalone file that performs arbitrary sets of operations (a script), or it can be a file that is meant to be
called by other commands in order to perform a specific task (a function).
Begin your code with an appropriate header, substituting your personal information for mine:
% Mark Styczynski
% GT account ID: mstyczynski6
% ChBE 2120
% Homework 1
% Due: Friday, January 14, 2011
This should be how every script file that you write begins.
Function files should include this
information after the function declaration.
The % characters that begin each of those lines tell MATLAB that these are only comments, not code.
Now enter the following MATLAB commands into the mfile:
clear all
% This section will work with scalar numbers
%Define our scalars
foo = 10;
bar = 4;
% Now perform test operations on our scalars
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Spring '07
 Gallivan

Click to edit the document details