O'Reilly logo

MATLAB® by Example by Francis Lilley, Munther Gdeisat

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9

Structures in Matlab

Chapter Outline

Lesson 9.1 Structures in Matlab

Lesson 9.2 A Vector of Structures

Answers to Selected Exercises

Project: The Fox and Rabbit Game

Lesson 9.1 Structures in Matlab

Objectives

• To learn how to construct a structure in Matlab.

• To learn how to write a structure function in Matlab.

Topics

9.1.1 The Need for the Structure Class

9.1.2 Functions for Structures

9.1.1 The Need for the Structure Class

You have studied vectors and arrays in this book. You can use the vectors and arrays to save a collection of identical classes. For example, the vector x saves a collection of numbers with the double class, as shown below:

In this second example, the array Y saves a collection of numbers with the logical class.

In ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required