Basics of MATLAB and Beyond
eBook - ePub

Basics of MATLAB and Beyond

Andrew Knight

Share book
  1. 216 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Basics of MATLAB and Beyond

Andrew Knight

Book details
Book preview
Table of contents
Citations

About This Book

MATLAB The tremendously popular computation, numerical analysis, signal processing, data analysis, and graphical software package-allows virtually every scientist and engineer to make better and faster progress. As MATLAB's world-wide sales approach a half-million with an estimated four million users, it becomes a near necessity that professionals a

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Basics of MATLAB and Beyond an online PDF/ePUB?
Yes, you can access Basics of MATLAB and Beyond by Andrew Knight in PDF and/or ePUB format, as well as other popular books in Matemáticas & Matemáticas general. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9780429525186
Beyond the Basics
Prelude
This part of the book assumes that you already have some competency with MATLAB. You may have been using it for a while and you find you want to do more with it. Perhaps you have seen what other people do and are wondering how it is done. Well, read on.
This part of the book follows an introductory course in MATLAB (Part I) that covered the basics: matrices, typing shortcuts, basic graphics, basic algebra and data analysis, basics of m-files and data files, and a few simple applications, such as curve fitting, FFTs, and sound. Basic handle graphics were introduced using set and get.
We begin by looking at sparse matrices and strings, go on to deal with some of the data types that are new to MATLAB version 5: cell arrays, multidimensional arrays and structures, then deal with a variety of topics that you will probably have to deal with at some stage if you are a frequent user of MATLAB. The book can be worked through from start to finish, but if you are not interested in a particular topic, you can skip over it without affecting your understanding of later topics. Exercises are given throughout the book, and answers to most of them are given at the end. We start by introducing some new variable types that go beyond the functionality of a rectangular matrix.
25 Sparse Arrays
In some applications, matrices have only a few non-zero elements. Such matrices might arise, for example, when analysing communication networks or when performing finite element modelling. MATLAB provides sparse arrays for dealing with such cases. Sparse arrays take up much less storage space and calculation time than full arrays.
25.1 Example: Airfoil
Suppose we are doing some finite element modelling of the airflow over an aeroplane wing. In finite element modelling you set up a calculation grid whose points are more densely spaced where the solution has high gradients. A suitable set of points is contained in the file airfoil:
Image
There are 4253 points distributed around the main wing and the two flaps. In carrying out the calculation, we need to define the network of interrelationships among the points; that is, which group of points will be influenced by each point on the grid. We restrict the influence of a given point to the points nearby. This information is stored in the vectors i and j, included in the loaded data. Suppose all the points are numbered 1, 2, …, 4253. The i and j vectors describe the links between point i and point j. For example, if we look at the first five elements:
≫ [i(1:5) j(1:5]’
ans =
1
2
3
5
4
2
3
10
10
11
The interpretation is that point 1 is connected to point 2, point 2 is connected to point 3, points 3 and 5 are connected to point 10, and so on. We create a sparse adjacency matrix, A, by using i and j as inputs to the sparse function:
Image
The spy function plots a sparse matrix with a dot at the positions of all the non-zero entries, which number 12,289 here (the length of the Ni and j vectors). The concentration of non-zero elements near the diagonal reflects the local nature of the interaction (given a reasonable numbering scheme). To plot the geometry of the interactions we can use the gplot function:
Image
(Try zooming in on this plo...

Table of contents