Category Archive for: Numeric Cell And Structure Arrays

Vectors and DisplaceIpent

Vectors and DisplaceIpent  Suppose two divers start at the surface and establish the following coordinate system: x is to the west, y is to the north, and ; is down. Diver I swims 55 ft west, 36 ft north, and then dives 25 ft. Diver 2 dives 15 ft, then swims east 10 ft and then north…

Read More →

vectors-and-relative-velocity

vectors-and-relative-velocity A train is heading east at 60 mi/hr. A car approaches the track crossing heading northeas~- at 45 mi/hr on a road that makes a 55° angle with the track. See Figure 2.3-3. Whatis-the velocity of the train relative to the car? What is the speed of the train relative.tethe car?  Solution • Solution Velocity is…

Read More →

Structure Arrays

2.7 Structure Arrays Structure arrays are composed of structures. This class of arrays enables you to store dissimilar arrays together. The elements in structures are accessed using . named fields. This feature: distinguishes them from cell arrays, which are accssed using the standard array indexing operations Structure arrays are used in this text only in (his section…

Read More →

Cell Arrays

2.6 Cell Arrays The cell array is an array in which each element is a bin, or cell, which can contain an array. You can store different classes of arrays in a cell array, and you can group data sets that are related but have different dimensions. You access cell arrays’ using the same index 109 operations used…

Read More →

Matrix Operations

2.4 Matrix Operations Matrix addition and subtraction are identical to element-by-element addition and subtraction. The corresponding matrix elements are summed or subtracted. However, matrix multiplication and division are not the same as element-by-element multiplication and division. Multiplication of  Vectors Recall that vectors are simply matrices with one row or one column. Thus matrix multiplication and division procedures apply to…

Read More →

Problems

Problems You can find the answers to problems marked with an asterisk at  he end of the text. Section 2.1 1. a. Use two methods to create the vector x having 100 regularly  paced values starting at 5 and ending at 28. b. Use two methods to create the vector x having a regular spacing of…

Read More →

A Student Database

A Student Database Create a structure array to contain the following types of student data: • Student name. • Social Security number. :. Email address. • Test scores. Enter the data shown in Figure 2.7-1 into the database Solution You can create the structure array by typing the following either in the interactive mode or in…

Read More →

Summary

Summary You should now be able to perform basic operations and use arrays in MATLAB. For example, you should be able to Create, address, and edit arrays. Perform array operations including addition,  subtraction, multiplication,  division, and exponentiation. • Perform matrix operations including addition, subtraction, multiplication, division, and exponentiation. • Perform polynomial algebra. • Create databases using cell and…

Read More →

Polynomial Operations Using Arrays

2.5 Polynomial Operations Using Arrays MATLAB has some convenient vector-based tools for working with polynomials, which are used in many advanced courses and applications in engineering. Type help polyfun for more information on this category of commands. We will use the following notation to describe a polynomial: f(x) =alxn +a2Xn-1 + a3Xn-2 + … +an_Ix2 +anx + an+1…

Read More →

Element-by-Element Operations

2.3  Element-by-Element Operations  To increase the magnitude of a vector, multiply it by a scalar. For example, to double the magnitude of the vector r = [ 3 , 5, 2] •multiply each component by two to obtain [6, 10 , 4 ] . In MATLAB you type v = 2 *r. See Figure 2.3-1 for the geometric interpretation…

Read More →

Back to Top