Category Archive for: An Overview of MATLAB

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…

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…

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:…

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…

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…

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…

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…

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      …