Category Archive for: An Overview of MATLAB

EXAMPLE

Growth of a Bank Account Determine how long it will take to accumulate at least $10.000 in a bank account if you deposit $500 initially and $500 at the end of each year. if the account pays 5 percent annual interest. Solution Because we do not know how many years it will take, a while loop should…

Read More →

EXAMPLE

Series Calculation with a while Loop Write a script file to determine how many terms are required for the sum of the series 5k2 – 2k; k = I, 2, 3…. to exceed 10,000. What is the sum for this many terms? Solution Because we do not know how many times we must evaluate the…

Read More →

EXAMPLE

Series Calculation with a for Loop Write a script file to compute the sum of the first 15 terms in the series 5k2 – 2k, k = 1.2.3….. ,5. Solution Because we know how many times we must evaluate the expression 5k2 – 2k. we can use a for loop. The script file is the following:…

Read More →

EXAMPLE

Plotting with a for Loop Write a script file to plot the function: Solution We choose a spacing dx = 35/300 to obtain 301 points, which is sufficient to obtain a smooth plot. The script file is the following: Note that we must use the index k to refer to x within the loop, as x…

Read More →

EXAMPLE

Analysis of Temperature Data The arrays temp_A and temp_B given in the table contain the water temperature in degrees Fahrenheit of two ponds measured at noon for JO days. Determine how many days the temperature of pond A was above 60′. On what days did this occur? Determine the temperature of pond A on the days when it…

Read More →

EXAMPLE

Volume of a Circular Cylinder The volume of a circular cylinder of height h and radius r is given by V = π r² h, particular cylindrical tank is 15 m tall and has a radius of 8 m. We want to cons another cylindrical tank with a volume 20 percent greater but having the same height. How…

Read More →

Examples

Piston Motion Figure 1.7-2a shows a piston, connecting rod, and crank for an internal combustion engine. When combustion occurs, it pushes the piston down. This motion causes the connecting rod to turn the crank, which causes the crankshaft to rotate. We want to develop a MATLAB program to compute and plot the distance d traveled by the piston…

Read More →

Problems

Answers to problems marked with an asterisk are given at the end of the text. Make sure you know how to start and quit a MATLAB session. Use MATLAB to make the following calculations, using the values: x = 10, Y = 3. Check the results using a calculator. a. u = x + Y      …

Read More →

Summary

You should now be familiar with basic operations in MATLAB. These include Starting and exiting MATLAB, Computing simple mathematical expressions, and Managing variables You should also be familiar with the MATLAB menu and toolbar system. The chapter gives an overview of the various types of problems MATLAB can solve. These include Using arrays and polynomials, Using…

Read More →

Problem-Solving Methodologies

Designing new engineering devices and systems requires a variety of problem solving skills. (This variety is what keeps engineering from becoming boring! When solving a problem, it is important to plan your actions ahead of time. You can ‘waste many hours by plunging into the problem without a plan of attack. Here we present a plan of attack, or…

Read More →

Back to Top