Showing posts with label matlab software. Show all posts
Showing posts with label matlab software. Show all posts

Saturday, 6 July 2013

Plotting Vectors on matlab

Whereas other computer languages, such asFortran, work on numbers  one at a time, an advantage of matlab is that it handles the matrix as a single unit. Let us consider an example that shows why this is useful.
Imagine you want to plot the functiony= sinxforxbetween 0 and 2π. AFortrancode to do this might look like this:
DIMENSION X(100),Y(100)
PI = 4*ATAN(1)
DO 100 I = 1,100
X(I) = 2*PI*I/100
Y(I) = SIN(X(I))
100 CONTINUE
PLOT(X,Y)
Here we assume that we have access to aFortranplotting package in which PLOT(X,Y)makes sense. Inmatlabwe can get our plot by typing:
x = 0:.1:2*pi;
y = sin(x);
plot(x,y)
The first line uses the colon operator to generate a vectorxof numbers running between 0 and 2πwith increment 0.1. The second line calculates the sine of this array of numbers, and calls the resulty. The third line
produces a plot ofyagainstx. Go ahead and produce the plot. You should get a separate window displaying this plot. We have done in three lines of matlabwhat it took us seven lines to do using theFortran
program above.

Thursday, 4 July 2013

Getting Started

                                                                      Chapter 1
Getting Started

                    In this chapter, we will introduce you to the tools you need to begin using MATLAB effectively. These include: some relevant information on computer platforms and software versions; installation and location protocols; how to launch the program, enter commands, use online help, and recover from hang-ups; a roster of MATLAB’s various windows; and finally, how to quit the soft-ware. We know you are anxious to get started using MATLAB, so we will keep this chapter brief. After you complete it, you can go immediately to Chapter 2 to find concrete and simple instructions for the use of MATLAB. We describe
the MATLAB interface more elaborately in Chapter 3.
Platforms and Versions

It is likely that you will run MATLAB on a PC (running Windows or Linux) or on some form of UNIX operating system. (The developers of MATLAB, The MathWorks, Inc., are no longer supporting Macintosh. Earlier versions of MATLAB were available for Macintosh; if you are running one of those, you
should find that our instructions for Windows platforms will suffice for your needs.) Unlike previous versions of MATLAB, version 6 looks virtually identi-cal on Windows and UNIX platforms. For definitiveness, we shall assume the reader is using a PC in a Windows environment. In those very few instances
where our instructions must be tailored differently for Linux or UNIX users,
we shall point it out clearly.
➱We use the word Windows to refer to all flavors of the Windows
operating system, that is, Windows 95, Windows 98, Windows 2000,
Windows Millennium Edition, and Windows NT.

This book is written to be compatible with the current version of MATLAB, namelyversion6 (alsoknownasRelease12). Thevastmajorityof theMATLAB commands we describe, as well as many features of the MATLAB interface (M-files, diary files, M-books, etc.), are valid for version 5.3 (Release 11), and
even earlier versions in some cases. We also note that the differences between the Professional Version and the Student Version (not the Student Edition) of MATLAB are rather minor and virtually unnoticeable to the new, or even mid-level, user. Again, in the few instances where we describe a MATLAB
feature that is only available in the Professional Version, we highlight that fact clearly.

A Guide to MATLAB for Beginners and Experienced Users

  • A Guide to MATLAB
  • This book is a short, focused introduction to MATLAB, a comprehen-sive software system for mathematics and technical computing. It will
    be useful to bothbeginning and experienced users. It contains concise
    explanations of essential MATLAB commands, as well as easily under-stood instructions for using MATLAB’s programming features, graphi-cal capabilities, and desktop interface. It also includes an introduction
    to SIMULINK, a companion to MATLAB for system simulation.
    Written for MATLAB 6, this book can also be used with earlier (and
    later) versions of MATLAB. This book contains worked-out examples
    of applications of MATLAB to interesting problems in mathematics,
    engineering, economics, and physics. In addition, it contains explicit
    instructions for using MATLAB’s Microsoft Word interface to produce
    polished, integrated, interactive documents for reports, presentations,
    or online publishing.
    This book explains everything you need to know to begin using
    MATLAB to do all these things and more. Intermediate and advanced
    users will find useful information here, especially if they are making
    the switch to MATLAB 6 from an earlier version.
    Brian R. Hunt is an Associate Professor of Mathematics at the Univer-sity of Maryland. Professor Hunt has coauthored four books on math-ematical software and more than 30 journal articles. He is currently
    involved in researchon dynamical systems and fractal geometry.
    Ronald L. Lipsman is a Professor of Mathematics and Associate Dean
    of the College of Computer, Mathematical, and Physical Sciences at the
    University of Maryland. Professor Lipsman has coauthored five books
    onmathematical software andmore than70 researcharticles. Professor
    Lipsmanwas the recipient of both theNATOandFulbrightFellowships.
    Jonathan M. Rosenberg is a Professor of Mathematics at the Univer-sity of Maryland. Professor Rosenberg is the author of two books on
    mathematics (one of them coauthored by R. Lipsman and K. Coombes)
    and the coeditor ofNovikov Conjectures, Index Theorems, and Rigidity,
    a two-volume set from the London Mathematical Society Lecture Note
    Series (Cambridge University Press, 1995)