Basics of MATLAB and Beyond
eBook - ePub

Basics of MATLAB and Beyond

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

Basics of MATLAB and Beyond

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

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
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.
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.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
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 Mathematics & Applied Mathematics. We have over one million books available in our catalogue for you to explore.

Information

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

  1. Cover
  2. Half Title
  3. Title Page
  4. Copyright Page
  5. Table of Contents
  6. I Basics of MATLAB
  7. II Beyond the Basics
  8. Index