Engineering Fundamentals: An Introduction to Engineering, 4th ed.c
As shown in Figure 15.1, the MATLAB’s desktop layout, in default mode, is divided into four win- dows: the Current Folder, the C ...
vehicle, you not only have to specify how fast it is moving (speed), but also its direction. The physical variables that possess ...
Note that in MATLAB, the elements of the matrix are enclosed in brackets [ ]and are separated by blank space, and the elements o ...
formatting characters, such as \nand \t, to produce linefeed and tabs. The following example will demonstrate the use of the fpr ...
Note that in MATLAB language, the range is defined by a starting value, followed by a colon :, the increment followed by another ...
>>a+b ans = 8 7 8 6 >>a-b ans = 6 1 -2 -8 >>3*a ans = 21 12 9 -3 >>3.*a ans = 21 12 9 -3 >>a.*b an ...
15.1 MATLAB —Basic Ideas 469 ■Figure 15.4 The result of Example 14.1. (Revisited). Using MATLAB, we want to create a table that ...
470 Chapter 15 MATLAB TABLE 15.6 The Relationship between the Interest Earned and the Amount Deposited Dollar Interest Rate Amou ...
15.2 Using MATLAB Built-in Functions 471 On the last command line, note that the three periods ...(an ellipsis) represents a con ...
472 Chapter 15 MATLAB TABLE 15.8 More Examples of MATLAB Functions Function Description of the Function sqrt(x) Returns the squa ...
15.2 Using MATLAB Built-in Functions 473 TABLE 15.9 Data for Example 14.4 (Revisited) Group-A Findings Group-B Findings r(kg /m ...
474 Chapter 15 MATLAB The Loop Control — forand whilecommands When writing a computer program, often it becomes necessary to exe ...
15.2 Using MATLAB Built-in Functions 475 TABLE 15.10 MATLAB’s Logical Operators Logical Operator Symbol Description and & TR ...
476 Chapter 15 MATLAB The ifStatement The ifstatement is the simplest form of a conditional control. Using the if statement, you ...
MATLAB also provides the elseifcommand that could be used with the ifand elsestate- ments. It is left for you to learn about it. ...
478 Chapter 15 MATLAB The M-file As explained previously, for simple operations you can use MATLAB’s Command Window to enter var ...
15.2 Using MATLAB Built-in Functions 479 ■Figure 15.9 The M-file for Example 15.3. ■Figure 15.10 The results of Example 15.3. Ne ...
480 Chapter 15 MATLAB 15.3 Plotting with MATLAB MATLAB offers many choices when it comes to creating charts. For example, you ca ...
481 ■Figure 15.13 The plot of volume versusxfor Example 15.4. Let us now discuss the MATLAB commands that commonly are used when ...
482 Chapter 15 MATLAB ■Figure 15.14 MATLAB’s Line Property Editor. For example, if you issue the command plot (x,y,'k*-'),MATLAB ...
«
20
21
22
23
24
25
26
27
28
29
»
Free download pdf