100% found this document useful (2 votes)
28 views

MATLAB for neuroscientists an introduction to scientific computing in MATLAB 1st Edition Pascal Wallisch - The ebook is ready for download with just one simple click

The document promotes the book 'MATLAB for Neuroscientists: An Introduction to Scientific Computing in MATLAB' by Pascal Wallisch and others, which serves as a comprehensive guide for using MATLAB in neuroscience research. It outlines the structure of the book, which includes sections on data collection, analysis, and modeling, and emphasizes hands-on experience with MATLAB. Additionally, it provides links to various related eBooks available for download on ebookname.com.

Uploaded by

santorcayon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
28 views

MATLAB for neuroscientists an introduction to scientific computing in MATLAB 1st Edition Pascal Wallisch - The ebook is ready for download with just one simple click

The document promotes the book 'MATLAB for Neuroscientists: An Introduction to Scientific Computing in MATLAB' by Pascal Wallisch and others, which serves as a comprehensive guide for using MATLAB in neuroscience research. It outlines the structure of the book, which includes sections on data collection, analysis, and modeling, and emphasizes hands-on experience with MATLAB. Additionally, it provides links to various related eBooks available for download on ebookname.com.

Uploaded by

santorcayon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Endless Ebook, One Click Away – Start Downloading at ebookname.

com

MATLAB for neuroscientists an introduction to


scientific computing in MATLAB 1st Edition Pascal
Wallisch

https://ebookname.com/product/matlab-for-neuroscientists-an-
introduction-to-scientific-computing-in-matlab-1st-edition-
pascal-wallisch/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://ebookname.com


Click here to visit ebookname.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

An Introduction to Partial Differential Equations with


MATLAB Second Edition Coleman

https://ebookname.com/product/an-introduction-to-partial-
differential-equations-with-matlab-second-edition-coleman/

MATLAB An Introduction with Applications 1st Edition


Amos Gilat

https://ebookname.com/product/matlab-an-introduction-with-
applications-1st-edition-amos-gilat/

Introduction to MATLAB for Engineers 3rd Edition


William J. *Palm

https://ebookname.com/product/introduction-to-matlab-for-
engineers-3rd-edition-william-j-palm/

Nationalisms in Japan 1st Edition Naoko Shimazu

https://ebookname.com/product/nationalisms-in-japan-1st-edition-
naoko-shimazu/
Balkans into Southeastern Europe 1914 2014 A Century of
War and Transition 2nd Edition Lampe

https://ebookname.com/product/balkans-into-southeastern-
europe-1914-2014-a-century-of-war-and-transition-2nd-edition-
lampe/

Peterson s AP English Literature Composition Master the


AP English Literature Composition Test 1st Edition
Peterson'S

https://ebookname.com/product/peterson-s-ap-english-literature-
composition-master-the-ap-english-literature-composition-
test-1st-edition-petersons/

Girls and Education 3 16 Continuing Concerns New


Agendas 1st Edition Carolyn Jackson

https://ebookname.com/product/girls-and-
education-3-16-continuing-concerns-new-agendas-1st-edition-
carolyn-jackson/

The Art of LEGO MINDSTORMS NXT G Programming 1st


Edition Terry Griffin

https://ebookname.com/product/the-art-of-lego-mindstorms-nxt-g-
programming-1st-edition-terry-griffin/

Rules for the Transfer of Movables Wolfgang Faber

https://ebookname.com/product/rules-for-the-transfer-of-movables-
wolfgang-faber/
Calorimetry First Edition Feig

https://ebookname.com/product/calorimetry-first-edition-feig/
Academic Press. is an imprint of Elsevier

30 Corporate Drive, Suite 400, Burlington, MA 01803, USA


525 B Street, Suite 1900, San Diego, California 92101–4495, USA
84 Theobald’s Road, London WC1X 8RR, UK

This book is printed on acid-free paper.

Copyright # 2009, Elsevier Inc. All rights reserved

No part of this publication may be reproduced or transmitted in any form or by any


means, electronic or mechanical, including photocopy, recording, or any information
storage and retrieval system, without permission in writing from the publisher.

MATLABW is a trademark of The MathWorks, Inc. and is used with permission. The
MathWorks does not warrant the accuracy of the text or exercises in this book. This book’s
use or discussion of MATLABW software or related products does not constitute endorsement
or sponsorship by The MathWorks of a particular pedagogical approach or particular use of
the MATLABW software.

Permissions may be sought directly from Elsevier’s Science & Technology Rights
Department in Oxford, UK: phone (þ44) 1865 843830, fax: (þ44) 1865 853333,
E-mail: [email protected]. You may also complete your request online
via the Elsevier homepage (http://elsevier.com/), by selecting “Support & Contact” then “Copyright
and Permission” and then “Obtaining Permissions.”

Library of Congress Cataloging-in-Publication Data


MATLAB for neuroscientists : an introduction to scientific computing in
MATLAB / Pascal Wallisch . . . [et al.].
p. ; cm.
Includes bibliographical references and index.
ISBN 978-0-12-374551-4 (hardcover : alk. paper)
1. Neuroscience–Data processing. 2. MATLAB. I. Wallisch, Pascal,
1978-
[DNLM: 1. Computing Methodologies. 2. Neurosciences. WL 26.5 M433 2009]
QP357.5.M38 2009
612.80285–dc22
2008028494

British Library Cataloguing-in-Publication Data


A catalogue record for this book is available from the British Library.

IBSN: 978-0-12-374551-4

For information on all Academic Press publications


visit our Web site at www.elsevierdirect.com

Printed in China
08 09 10 9 8 7 6 5 4 3 2 1
Preface

I hear and I forget.


I see and I remember.
I do and I understand.
Confucius

The creation of this book stems from a set specialized—software for stimulus genera-
of courses offered over the past several years tion, data collection, data analysis, and data
in quantitative neuroscience, particularly modeling, respectively. Although this alter-
within the graduate program in compu- native is a feasible strategy, it does intro-
tational neuroscience at the University of duce a number of problems: namely, the
Chicago. This program started in 2001 and need to convert data between different plat-
is one of the few programs focused on forms and formats and to keep up with a
computational neuroscience with a com- wide range of software packages as well
plete curriculum including courses in as the need to learn ever-new specialized
cellular, systems, behavioral, and cognitive home-cooked “local” software when enter-
neuroscience; neuronal modeling; and ing a new lab. As we have realized in our
mathematical foundations in computational own professional life as scientists, these
neuroscience. Many of these courses in- obstacles can be far from trivial and a
clude not only lectures but also lab sessions significant detriment to productivity.
in which students get hands-on experience We also believe that our comprehensive
using the MATLABW software to solve MATLAB “strategy” makes particular sense
various neuroscientific problems. for educational purposes, as it empowers
The content of our book is oriented along users to progressively solve a wide variety
the philosophy of using MATLAB as a com- of computational problems and challenges
prehensive platform that spans the entire within a single programming environment.
cycle of experimental neuroscience: stimu- It has the added advantage of an elegant
lus generation, data collection and experi- progression within the problem space. Our
mental control, data analysis, and finally experience in teaching has led us to this
data modeling. We realize that this approach that does not focus on the inher-
approach is not universally followed. Quite ent structure of MATLAB as a computer
a number of labs use different—and programming language but rather as a tool

vii
viii PREFACE

for solving problems within neuroscience. examples in a set of exercises. Finally, a


In addition, it is well founded in our current project is assigned at the end of the chapter
understanding of the learning process. which requires integrating the parts into
Constant use of the information forces the a coherent whole. Based on our experience,
repeated retrieval of the introduced con- we believe that these chapters can serve as
cepts, which—in turn—facilitates learning self-contained “lab” components of a course
(Karpicke & Roediger, 2008). if this book is used in the context of
The book is structured in four parts, each teaching.
with several chapters. The first part serves In essence, we strived to write the book
as a brief introduction to some of the most that we wished to have had when first
commonly used functions of the MATLAB learning MATLAB ourselves, as well as the
software, as well as to basic programming book that we would have liked to have
in MATLAB. Users who are already famil- had when teaching MATLAB to our stu-
iar with MATLAB may skip it. It serves the dents in the past. Our hope is that this is
important purpose of a friendly invitation the very book you are holding in your
to the power of the MATLAB environment. hands right now.
It is elementary insofar as it is necessary to We could have not written this book with-
have mastered the content within before out the continuous support of a large number
progressing any further. Later parts focus of friends. First and foremost, we would like
on the use of MATLAB to solve computa- to thank our families for their kind support,
tional problems in neuroscience. The sec- their endless patience, as well as their untiring
ond part focuses on MATLAB as a tool for encouragement. We also would like to extend
the collection of data. For the sake of gener- thanks to our students who provided the ini-
ality, we focus on the collection of data from tial impetus for this undertaking as well as
human subjects in these chapters, although for providing constant feedback on previous
the user can easily adapt them for the collec- versions of our manuscript. Steve Shevell
tion of animal data as well. The third part deserves thanks for suggesting that the project
focuses on MATLAB as a tool for data anal- is worth pursuing in the first place. In addition,
ysis and graphing. This part forms the core we would like to thank everyone at Elsevier
of the book, as this is also how MATLAB is who was involved in the production and
most commonly used. In particular, we development of this book—in particular our
explore the analysis of a variety of datasets, various editors, Johannes Menzel, Sarah Haj-
including “real” data from electrophysiol- duk, Clare Caruana, Christie Jozwiak, Chuck
ogy as well as neuroimaging. The fourth Hutchinson, Megan Wickline, and Meg
part focuses on data modeling with Day—their resourcefulness, professionalism
MATLAB, and appendices address the phi- and patience really did make a big difference.
losophy of MATLAB as well as the underly- Curiously, there was another Meg involved
ing mathematics. Each chapter begins with with this project, specifically Meg Vulliez from
the goals of the chapter and a brief The MathWorks™ book program. In addition,
background of the problem of interest (neu- we would like to thank Kori Lusignan and
roscientific or psychological), followed by Amber Martell for help with illustrations and
an introduction to the MATLAB concepts Wim van Drongelen for advice and guidance
necessary to address the problem by break- in the early stages of this project. Moreover,
ing it down into smaller parts and we thank Armen Kherlopian and Gopathy
providing sample code. You are invited to Purushothaman who were kind enough to
modify, expand, and improvise on these provide us with valuable insights throughout
PREFACE ix
our undertaking. We also would like to thank explicitly but deserves our praise. Finally, we
Kristine Mosier for providing the finger- would like to thank you, the reader, for your
tapping functional magnetic imaging data that willingness to join us on this exciting journey.
we used in the fMRI lab and would like to We sincerely hope that we can help you reach
thank Aaron Suminski for his help in the your desired destination.
post-processing of that data. Importantly, we
thank everyone whom we neglected to name The authors
About the Authors

Pascal Wallisch, PhD, Center for Neural Tanya I. Baker, PhD, Junior Research Fel-
Science, New York University low, Crick-Jacobs Center for Theoretical
Pascal received his PhD from the University Neurobiology, The Salk Institute for
of Chicago and is now a postdoctoral fellow Biological Studies, La Jolla, California
at New York University. He is currently Tanya is a junior research fellow modelling
studying the processing of visual motion. large-scale neuronal population dynamics
Pascal is passionate about teaching, as well using modern statistical methods. Previ-
as the communication of scientific concepts ously, she was a post-doctoral lecturer at
to a wider audience. He was recognized for the University of Chicago where she devel-
his distinguished teaching record by the oped and taught Mathematical Methods for
University of Chicago Booth Prize. the Biological Sciences, a new year-long
course with a computer lab component.
Michael Lusignan, Committee on Compu- She received her PhD in Physics at the Uni-
tational Neuroscience, University of versity of Chicago and her BS in Physics
Chicago and Applied Mathematics at UCLA.
Michael is an advanced graduate student
who has enjoyed teaching several courses Adam Dickey, Committee on Computa-
involving MATLAB to graduate, as well as tional Neuroscience, University of Chicago
undergraduate students. He infuses his teach- Adam is an MD/PhD candidate at the Uni-
ing with eight years of experience in active versity of Chicago. He is currently a gradu-
software development. His current interests ate student in the laboratory of Dr. Nicholas
include sensory encoding in neuroethological Hatsopoulos. Adam is interested in improv-
model systems. ing decoding techniques used for neural
prosthetic control.
Marc Benayoun, Committee on Computa-
tional Neuroscience, University of Chicago Nicholas G. Hatsopoulos, PhD, Depart-
Marc is an MD/PhD student currently ment of Organismal Biology and Anatomy
interested in applying statistical field the- & Department of Neurology, University of
ory to study neural networks with applica- Chicago
tions to epilepsy. He has an extensive Nicholas is Associate Professor and Chair-
teaching record and was also awarded the man of the graduate program on Computa-
University of Chicago Booth Prize. tional Neuroscience. He teaches a course in

xi
xii ABOUT THE AUTHORS

Cognitive Neuroscience which formed the of the arm and hand. He is also developing
basis for some of the chapters in the book. brain-machine interfaces by which patients
His research focuses on how ensembles of with severe motor disabilities could activate
cortical neurons work together to control, large groups of neurons to control external
coordinate, and learn complex movements devices.
How to Use This Book

A text of a technical nature tends to be specific, while the suggestions for exploration
more readily understood if its design princi- tend to be of a rather sweeping nature. This
ples are clear from the very outset. This is process of successive introduction and rein-
also the case with this book. Hence, we will forcement of functions and concepts culmi-
use this space to briefly discuss what we nates in a “project”, a large programming
had in mind when writing the chapters. task that ties all the material covered in the
Hopefully, this will improve usability and book together. This will allow you to put
allows you to get most out of the book. the learned materials to immediate use in a
larger goal, often utilizing “real” experimen-
tal data. Finally, we list the MATLAB func-
tions introduced in the chapter at the very
STRUCTURAL AND end. It almost goes without saying that
CONCEPTUAL you will get the most out of this book if you
CONSIDERATIONS have a version of MATLAB open and run-
ning while going through the chapters. That
A chapter typically begins with a concise way, you can just try out the functions we
overview of what material will be covered. introduce, try out new code, etc.
Moreover, we usually put the chapter in the Hence, we implicitly assumed this to be
broader context of practical applications. the case when writing the book.
This brief introduction is followed by a dis- Moreover, we made sure that all the code
cussion of the conceptual and theoretical works when running the latest version of
background of the topic in question. The MATLAB (currently 7.7). Don’t let this con-
heart of each chapter is a larger section in cern you too much, though. The vast major-
which we introduce relevant MATLABW ity of code should work if you use anything
functions that allow you to implement meth- above version 6.0. We did highlight some
ods or solve problems that tend to come up important changes where appropriate.
in the context of the chapter topic. This part
of the chapter is enriched by small exercises
and suggestions for exploration. We believe LAYOUT AND STYLE
that doing the exercises is imperative to
attain a sufficiently deep understanding of The reader can utilize not only the concep-
the function in question, while the sugges- tual structure of each chapter as outlined
tions for exploration are aimed at readers above, but also profit from the fact that we sys-
who are particularly interested in broadening tematically encoded information about the
their understanding of a given function. In function of different text parts in the layout
this spirit, the exercises are usually rather and style of the book.

xiii
xiv HOW TO USE THIS BOOK

The main text is set in 10/12 Palatino- COMPANION WEBSITE


Roman. In contrast, executable code is
bolded and offset by >>, such as this:
The successful completion of many chap-
>> figure ters of this book depends on additional
>> subplot(2,2,1) material (experimental data, sample solu-
>> image(test_disp) tions and other supplementary information)
which is accessible from the website that
The idea is to type this text (without the
accompanies this book. For example, a data-
>>) directly into MATLAB. Moreover, func-
base of executable code will be maintained
tions that are first introduced at this point
as long as the book is in print. For informa-
are bolded in the text. Exercises and Sugges-
tion on how to access this online repository,
tions for exploration are set in italics and
please see page ii.
separated from the main text by boxes.
Equations are set in 10/12 Palatino-
Roman. Sample solutions in 10/12 Palatino-
Bold.
C H A P T E R

1
Introduction

Neuroscience is at a critical juncture. In the past few decades, the essentially biological
nature of the field has been infused by the tools provided by mathematics. At first, the
use of mathematics was mostly methodological in nature—primarily aiding the analysis
of data. Soon, this influence turned conceptual, framing the very issues that characterize
modern neuroscience today. Naturally, this development has not remained uncontroversial.
Some neurobiologists of yore resent what they perceive to be a hostile takeover of the field,
as many quantitative methods applied to neurobiology were pioneered by nonbiologists
with a background in physics, engineering, mathematics, statistics, and computer science.
Their concerns are not entirely without merit. For example, Hubel and Wiesel (2004) warn
of the faddish nature that the idol of “computation” has taken on, even likening it to a dan-
gerous disease that has befallen the field and that we should overcome quickly in order to
restore its health.
While these concerns are valid to some degree and while excesses do happen, we
strongly believe that—all in all—the effect of mathematics in the neurosciences has been
very positive. Moreover, we believe that our science is and will continue to be one that is
computational at its very core. Historically, this notion stems in part from the influence that
cognitive psychology has had in the study of the mind. Cognitive psychology and cognitive
science, more generally, posited that the mind and, by extension, the brain should be
viewed as an information processing device that receives inputs and transforms these
inputs into intermediate representations which ultimately generate observable outputs. At
the same time that cognitive science was taking hold in psychology in the 1950s and
1960s, computer science was developing beyond mere number crunching and considering
the possibility that intelligence could be modeled computationally, leading to the birth of
artificial intelligence. The information processing perspective, in turn, ultimately influenced
the study of the brain and is best exemplified by an influential book by David Marr titled
Vision, published in 1982. In that book, Marr proposed that vision and, more generally,
the brain should be studied at three levels of analysis: the computational, algorithmic,
and implementational levels. The challenge at the computational level is to determine what
computational problem a neuron, neural circuit, or part of the brain is solving. The

3
4 1. INTRODUCTION

algorithmic level identifies the inputs, the outputs, their representational format, and the
algorithm that takes the input representation and transforms it into an output representa-
tion. Finally, the implementational level identifies the neural “hardware” and biophysical
mechanisms that underlie the algorithm which solves the problem. Today, this perspective
has permeated not only cognitive neuroscience but also systems, cellular, and even molec-
ular neuroscience.
Importantly, such a conceptualization of our field places chief importance on the issues
surrounding scientific computing. For someone to participate in or even appreciate state
of the art debates in modern neuroscience, that person has to be well versed in the language
of computation. Of course, it is the task of education—if it is to be truly liberal—to enable
students to do so. Yet, this poses a quite formidable challenge.
For most students interested in neuroscience, mathematics amounts to what is essentially
a foreign language. Similarly, the language of scientific computing is typically as foreign to
students as it is powerful. The prospects of learning both at the same time can be daunting
and—at times—overwhelming. So what is a student or educator to do?
Immersion has been shown to be a powerful way to learn foreign languages (Genesee,
1985). Hence, it is imperative that students are using these languages as often as possible
when facing a problem in the field. For immersion to work, the learning experience has
to be positive, yielding useful results that solve some real or perceived problem. Unfortu-
nately, the inherent complexity as well as the seemingly arcane formalisms that characterize
both are usually very off-putting to students, requiring much effort with little tangible
yield, reducing the likelihood of further voluntary immersion.
To break this catch-22, the utility of learning these languages has to be drastically
increased while making the learning process more accessible and manageable at the same
time, even during the learning process itself. As we alluded to previously, this is a tall
order. Fortunately, there is a way out of this conundrum. Recent advances in software, as
well as hardware, have instantiated scientific computing within the framework of a unified
computational environment. One of these environments is provided by the MATLABW
software. For reasons that will become readily apparent in this book, MATLAB fulfills the
requirements that are necessary to meet and overcome the challenges outlined earlier.
In addition—and partly for these reasons—MATLAB has become the de facto standard of
scientific computing in our field. More strongly, MATLAB really has become the lingua
franca that all serious students of neuroscience are expected to understand in the very near
future, if not already today.
This, in turn, introduces a new—albeit more tractable—problem. How does one teach
MATLAB to a useful level of proficiency without making the study of MATLAB itself an
additional problem and simply another chore for students? Overcoming this problem as a
key to reaching the deeper goals of fluency in mathematics and scientific computing is
a crucial goal of this book. We reason that a gentle introduction to MATLAB with a special
emphasis on immediate results will computationally empower you to such a degree that the
practice of MATLAB becomes self-sustaining by the end of the book. We carefully picked
the content such that the result constitutes a confluence of ease (gradually increasing
sophistication and complexity) and relevance. We are confident that at the end of the book
you will be at a level where you will be able to venture out on your own, convinced of the
utility of MATLAB as a tool as well as your abilities to harness this power henceforth. We
1. INTRODUCTION 5
have tested the various parts of the contents of this book on our students and believe that
our approach has been successful. It is our sincere wish and hope that the material
contained will be as beneficial to you as it was to those students.
With this in mind, we would like to outline two additional specific goals of this book.
First, the material covered in the chapters to follow gives a MATLAB perspective on many
topics within computational neuroscience across multiple levels of neuroscientific inquiry
from decision-making and attentional mechanisms to retinal circuits and ion channels. It
is well known that an active engagement with new material facilitates both understanding
and long-time retention of said material. The secondary aim of this book is to acquire pro-
ficiency in programming using MATLAB while going through the chapters. If you are
already proficient in MATLAB, you can go right to the chapters following the tutorial.
For the rest, the tutorial chapter will provide a gentle introduction to the empowering qua-
lities that the mastery of a language of scientific computing affords.
We take a project-based approach in each chapter so that you will be encouraged to write
a MATLAB program that implements the ideas introduced in the chapter. Each chapter
begins with background information related to a particular neuroscientific or psychological
problem, followed by an introduction to the MATLAB concepts necessary to address that
problem with sample code and output included in the text. You are invited to modify,
expand, and improvise on these examples in a set of exercises. Finally, the project assign-
ment introduced at the end of the chapter requires integrating the exercises. Most of the
projects will involve genuine experimental data that are either collected as part of the project
or were collected through experiments in research labs. In some rare cases, we use published
data from classical papers to illustrate important concepts, giving you a computational
understanding of critically important research.
In addition, solutions to exercises as well as executable code can be found in the online
repository accompanying this book.
Finally, we would like to point out that we are well aware that there is more than one
way to teach—and learn—MATLAB in a reasonably successful and efficient manner. This
book represents a manifestation of our approach; it is the path we chose, for the reasons
we outlined here.
C H A P T E R

2
MATLAB Tutorial

2.1. GOAL OF THIS CHAPTER

The primary goal of this chapter is to help you to become familiar with the MATLABW
software, a powerful tool. It is particularly important to familiarize yourself with the user
interface and some basic functionality of MATLAB. To this end, it is worthwhile to at least
work through the examples in this chapter (actually type them in and see what happens).
Of course, it is even more useful to experiment with the principles discussed in this chapter
instead of just sticking to the examples. The chapter is set up in such a way that it affords
you time to do this.
If desired, you can work with a partner, although it is advisable to select a partner of similar
skill to avoid frustrations and maximize your learning. Advanced MATLAB users can skip this
tutorial altogether, while the rest are encouraged to start at a point where they feel comfortable.
The basic structure of this tutorial is as follows: each new concept is introduced through
an example, an exercise, and some suggestions on how to explore the principles that guide
the implementation of the concept in MATLAB. While working through the examples and
exercises is indispensable, taking the suggestions for exploration seriously is also highly
recommended. It has been shown that negative examples are very conducive to learning;
in other words, it is very important to find out what does not work, in addition to what
does work (the examples and exercises will—we hope—work). Since there are infinite ways
in which something might not work, we can’t spell out exceptions explicitly here. That’s
why the suggestions are formulated very broadly.

2.2. BASIC CONCEPTS

2.2.1. Purpose and Philosophy of MATLAB


MATLAB is a high-performance programming environment for numerical and technical
applications. The first version was written at the University of New Mexico in the 1970s.
The “MATrix LABoratory” program was invented by Cleve Moler to provide a simple

7
8 2. MATLAB TUTORIAL

and interactive way to write programs using the Linpack and Eispack libraries of FOR-
TRAN subroutines for matrix manipulation. MATLAB has since evolved to become an
effective and powerful tool for programming, data visualization and analysis, education,
engineering and research.
The strengths of MATLAB include extensive data handling and graphics capabilities,
powerful programming tools and highly advanced algorithms. Although it specializes in
numerical computation, MATLAB is also capable of performing symbolic computation by
having an interface with Maple (a leading symbolic mathematics computing environment).
Besides fast numerics for linear algebra and the availability of a large number of domain-
specific built-in functions and libraries (e.g., for statistics, optimization, image processing,
neural networks), another useful feature of MATLAB is its capability to easily generate var-
ious kinds of visualizations of your data and/or simulation results.
For every MATLAB feature in general, and for graphics in particular, the usefulness of
MATLAB is mainly based on the large number of built-in functions and libraries. The inten-
tion of this tutorial is not to provide a comprehensive coverage of all MATLAB features but
rather to prepare you for your own exploration of its functionality. The online help system is
an immensely powerful tool in explaining the vast collection of functions and libraries
available to you, and should be the most frequently used tool when programming in
MATLAB. Note that this tutorial will not cover any of the functions provided in any of
the hundreds of toolboxes, since each toolbox is licensed separately and their availability
to you can vary. We will indicate in each section if a particular toolbox is required. If you
have additional toolboxes available to you, we recommend using the online help system
to familiarize yourself with the additional functions provided. Another tool for help is the
Internet. A quick online search will usually bring up numerous useful web pages designed
by other MATLAB users trying to help out each other.
As stated previously, MATLAB is essentially a tool—a sophisticated one, but a tool nev-
ertheless. Used properly, it enables you to express and solve computational and analytic
problems from a wide variety of domains. The MATLAB environment combines computa-
tion, visualization, and programming around the central concept of the matrix. Almost
everything in MATLAB is represented in terms of matrices and matrix-manipulations. If
you would like a refresher on matrix-manipulations, a brief overview of the main linear
algebra concepts needed is given in Appendix B, “Linear Algebra Review.” We will start
to explore this concept and its power in detail later in this tutorial. For now, it is important
to note that, properly learned, MATLAB will help you get your job done in a very efficient
way. Giving it a serious shot is worth the effort.

2.2.2. Getting Started


You can start MATLAB by simply clicking on the MATLAB icon on your desktop or
taskbar. The command window will pop up, awaiting your commands and instructions.
In the context of this tutorial, all commands that are supposed to be typed into the
MATLAB command window, as well as expected MATLAB responses, are typeset in bold.
The beginnings of these commands are indicated by the >> prompt. You press Enter at the
end of this line, after typing the instructions for MATLAB. All instructions discussed in this
2.2. BASIC CONCEPTS 9
tutorial will be in MATLAB notation, to enhance your familiarity with the MATLAB
environment.
Don’t be afraid as you delve into this new programming world. Help is readily at hand.
Using the command help followed by the name of the command (for example, help save)
in the command window gives you a brief overview on how to use the corresponding com-
mand (i.e., the command save). You can also easily access these help files for functions or
commands by highlighting the command for which you need assistance in either the com-
mand window or in an M-file and right-clicking to select the Help on Selection option.
Entering the commands helpwin, helpdesk, or helpbrowser will also open the MATLAB
help browser. Besides these resources provided directly by the MATLAB program, do
not forget the usefulness of the Internet. Not only is additional online help available within
MATLAB, but numerous tutorials and advice can be found posted online by other
programmers in the MATLAB community.

2.2.3. MATLAB as a Calculator


MATLAB implements and affords all the functionality that you have come to expect from
a fine scientific calculator. While MATLAB can, of course, do much more than that, this is
probably a good place to start. This functionality also demonstrates the basic philosophy
behind this tutorial—discussing the principles behind MATLAB by showing how MATLAB
can make your life easier, in this case by replicating the functionality of a scientific calculator.
Elementary mathematical operations: Addition, subtraction, multiplication, division.
These operations are straightforward:
Addition:
>> 2 + 3
ans =
5
Subtraction:
>> 7 - 5
ans = 2
Multiplication:
>> 17 * 4
ans =
68
Division:
>> 24 / 7
ans =
3.4286
Random documents with unrelated
content Scribd suggests to you:
Plate 211

MONTSERRAT: REMAINS OF THE ANCIENT MONASTERY


Plate 212

MONTSERRAT: DOOR OF THE CHURCH


Plate 213

MONTSERRAT: INTERIOR OF THE CHURCH


Plate 214

MONTSERRAT: VIEW OF THE PEAKS


Plate 215

MONTSERRAT: THE DEVIL’S ROCK


Plate 216

MONTSERRAT: MIRANDA PEAK


Plate 217

VIEW OF MONTSERRAT, TAKEN FROM MONISTOL STATION


Plate 218

VIEW OF MONISTOL, TAKEN FROM MONTSERRAT


Plate 219

TORTOSA: GENERAL VIEW


Plate 220

TORTOSA: COURTYARD IN THE INSTITUTE


Plate 221

THE COURT, SAN FRANCISCO, PALMA, MALLORCA


GRAN HOTEL, PALMA, MALLORCA
Plate 222

PALACE OF THE ALMUDAINA, PALMA, MALLORCA


Plate 223

WINDMILL AND ELECTRICAL WORKS, PALMA, MALLORCA


Plate 224

VIEW OF THE “REAL CLUB DE REGATAS,” PALMA, MALLORCA


Plate 225

MARKET AND CHURCH OF SAN NICOLAS, PALMA, MALLORCA


SAN FRANCISCO, PALMA, MALLORCA
Plate 226

VIEW FROM THE HARBOUR, PALMA, MALLORCA


Plate 227

VIEW OF THE BAY, PALMA, MALLORCA


Plate 228

THE ALMUDAINA AND CATHEDRAL, PALMA, MALLORCA


Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like