
Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving
4th Edition
ISBN: 9780128045251
Author: Stormy Attaway Ph.D. Boston University
Publisher: Elsevier Science
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Chapter 5, Problem 5.1P
To determine
To write:
A for loop that will print a column of five *’s.
Expert Solution & Answer

Answer to Problem 5.1P
Solution:
The code to print a column of five’s has been created.
Explanation of Solution
Script file:
Declare
Print ‘5’ and go to the next line.
End the for loop.
MATLAB Code:
for i=1:4
%define the no. of elements.
fprintf('5\n')
%print a column of elements five.
end
Save the MATLAB script with the name, Chapter5_45251_5_1P.m in the current folder. Click on the Run tab in the toolbar of the script file.
Result:
Therefore, the code to print a column of five’s has been created.
Want to see more full solutions like this?
Subscribe now to access step-by-step solutions to millions of textbook problems written by subject matter experts!
Students have asked these similar questions
What is the explanation of the solution and answer to the problem:
Boxes of floor tiles are to be offered for sale at a special price of $75. The boxes claim to contain at least 100 tiles each.
b. How may the seller benefit if the numbers 12,16,7,8,21,4,11,6,5 and 10 are used to draw the stem-and-leaf diagram instead of the actual numbers of tiles?
Answer: Seller may notice that 10+16+7+8+21+4+11+6+5+10=100,which means that 11 (rather than ten) boxes of 100 tiles could be offered for sale.
What is the explanation of the solution and answer to the problem:
Boxes of floor tiles are to be offered for sale at a special price of $75. The boxes claim to contain at least 100 tiles each.
b. How may the seller benefit if the numbers 12,16,7,8,21,4,11,6,5 and 10 are used to draw the stem-and-leaf diagram instead of the actual numbers of tiles?
Answer: Seller may notice that 10+16+7+8+21+4+11+6+5+10=100,which means that 11 (rather than ten) boxes of 100 tiles could be offered for sale.
Table Summary: A table with 5 rows and 5 columns. The columns are titled y and the
column heads are 0, 1, 2, 3, and 4. The rows are titled X and the row heads are 0, 1, 2, 3,
and 4.
X
0
y
1
2
3
4
0
0.03
0.01
1
0.09
0.01
0.05 0.08 0.03 0.01
0.02 0.01
2
0.09
3
0.04
0.05 0.07 0.04 0.02
0.06 0.04 0.07 0.04 0.02
0.03 0.04
0.03 0.02
Refer to Exercise 9.
a. Find μx+Y.
b. Find σx+Y.
c. Find P(X + Y = 5).
Chapter 5 Solutions
Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving
Ch. 5 - Prob. 5.1PCh. 5 - Prob. 5.2PCh. 5 - Prob. 5.3PCh. 5 - Prob. 5.4PCh. 5 - Prob. 5.5PCh. 5 - Prob. 5.6PCh. 5 - Prob. 5.7PCh. 5 - Prob. 5.8PCh. 5 - Prob. 5.9PCh. 5 - Prob. 5.10P
Ch. 5 - Prob. 1ECh. 5 - Prob. 2ECh. 5 - Prob. 3ECh. 5 - Prob. 4ECh. 5 - Prob. 5ECh. 5 - Prob. 6ECh. 5 - Prob. 7ECh. 5 - Prob. 8ECh. 5 - Prob. 9ECh. 5 - Prob. 10ECh. 5 - Prob. 11ECh. 5 - Prob. 12ECh. 5 - Prob. 13ECh. 5 - Prob. 14ECh. 5 - Prob. 15ECh. 5 - Prob. 16ECh. 5 - Prob. 17ECh. 5 - Prob. 18ECh. 5 - Prob. 19ECh. 5 - Prob. 21ECh. 5 - Prob. 20ECh. 5 - Prob. 22ECh. 5 - Prob. 23ECh. 5 - Prob. 24ECh. 5 - Prob. 25ECh. 5 - Prob. 26ECh. 5 - Prob. 27ECh. 5 - Prob. 28ECh. 5 - Prob. 29ECh. 5 - Prob. 30ECh. 5 - Prob. 31ECh. 5 - Prob. 32ECh. 5 - Prob. 33ECh. 5 - Prob. 34ECh. 5 - Prob. 35ECh. 5 - Prob. 36ECh. 5 - Prob. 37ECh. 5 - Prob. 38ECh. 5 - Prob. 39ECh. 5 - Prob. 40ECh. 5 - Prob. 41ECh. 5 - Prob. 42ECh. 5 - Prob. 43E
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, statistics and related others by exploring similar questions and additional content below.Similar questions
- Assume that the cost of an engine repair is $50, and the cost of a transmission repair is $100. Let T represent the total cost of repairs during a one-hour time interval. y X 0 1 2 3 0 0.13 0.10 0.07 0.03 1 0.12 0.16 0.08 0.04 2 0.02 0.06 0.08 0.04 3 0.01 0.02 0.02 0.02 Find uT. Find σT. Find P (T=250).arrow_forwardFor continuous random variables X and Y with joint probability density function a. Find P(X > 1 and Y > 1). xe-(x+2y) f(x, y) = x > 0 and y > 0 0 otherwise b. Find the marginal probability density functions fx(x) and fy(y). c. Are X and Y independent? Explain.arrow_forwardWhat is the detailed solution and explanation on how to get the answer in questions 11b and 11c?arrow_forward
- How did we come up with the graph in the solution? What are the ordered pairs in both solid line and broken line graphs and how did we get those points?arrow_forwardThe data below shows the number of jobs that a sample of people had in their lifetime: 6 10 10 10 10 11 11 11 12 12 13 13 13 15 15 Provide the five-number summary: (Round the answers to 2 decimal places) Min 6.00 Create the boxplot: 6 7 8 9 6 7 8 7 8 00 Q1 10.00 10 Median 11.00 11 12 13 14 The number of jobs 9 10 11 12 The number of jobs 13 14 15 9 10 11 12 13 14 15 The number of jobs 6 7 8 9 10 11 12 The number of jobs 13 14 15 Q3 Max 13.00 15.00arrow_forwardA random sample of high schooler's hourly rates (in dollars) at part time jobs are recorded in the table below. Salary 11.45 11.10 11.20 12.30 12.60 14.50 17.90 12.10 12.30 50.15 a. For the data shown above, find the following. Round the answer in the first blank to 2 decimal places. Put the correct units in the second blank. Find the mean: 16 Find the median: Find the mode: b. Remove the high math tutor salary of 50.15 dollars from the data. Recompute the following. Round the answer in the first blank to 2 decimal places. Put the correct units in the second blank. Find the mean: Find the median: Find the mode: c. Which of the following statistics was most affected by removing the high math tutor salary from the data? O mode mean O medianarrow_forward
- Calculate the 22th percentile of the data shown 16.3 18.7 33.2 35.5 46.7 47.2 49.3 58.3 61.3 61.8arrow_forwardPlease use R to answer the following question: The built in dataset faithful records the time between eruptions and the length of the prior eruption (both in minutes) for 272 inter-eruption intervals (load the data with data(faithful)).arrow_forwardplease do not answer !The scores on a college entrance exam are approximately normally distributed with a mean of 500 and a standard deviation of 100. What percentage of students score above 650? What percentage score between 400 and 600? What score marks the top 10% cutoff (i.e., the 90th percentile)? If a random sample of 25 students is taken, what is the probability their average score exceeds 520?arrow_forward
- Is the graph of percentage cumulative frequency polygon in question 9a correct and what are the ordered pairs in creating the graph?arrow_forwardStatistics and probability. no answerarrow_forwardA company knows that battery lifetimes are normally distributed with mean 20 hours and standard deviation 4 hours. If a sample of 16 batteries is tested, what is the probability the sample mean lifetime is greater than 21 hours?arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Holt Mcdougal Larson Pre-algebra: Student Edition...AlgebraISBN:9780547587776Author:HOLT MCDOUGALPublisher:HOLT MCDOUGALAlgebra: Structure And Method, Book 1AlgebraISBN:9780395977224Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. ColePublisher:McDougal Littell
- College Algebra (MindTap Course List)AlgebraISBN:9781305652231Author:R. David Gustafson, Jeff HughesPublisher:Cengage LearningGlencoe Algebra 1, Student Edition, 9780079039897...AlgebraISBN:9780079039897Author:CarterPublisher:McGraw HillMathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,

Holt Mcdougal Larson Pre-algebra: Student Edition...
Algebra
ISBN:9780547587776
Author:HOLT MCDOUGAL
Publisher:HOLT MCDOUGAL

Algebra: Structure And Method, Book 1
Algebra
ISBN:9780395977224
Author:Richard G. Brown, Mary P. Dolciani, Robert H. Sorgenfrey, William L. Cole
Publisher:McDougal Littell


College Algebra (MindTap Course List)
Algebra
ISBN:9781305652231
Author:R. David Gustafson, Jeff Hughes
Publisher:Cengage Learning

Glencoe Algebra 1, Student Edition, 9780079039897...
Algebra
ISBN:9780079039897
Author:Carter
Publisher:McGraw Hill

Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,
Polynomials with Trigonometric Solutions (2 of 3: Substitute & solve); Author: Eddie Woo;https://www.youtube.com/watch?v=EnfhYp4o20w;License: Standard YouTube License, CC-BY
Quick Revision of Polynomials | Tricks to Solve Polynomials in Algebra | Maths Tricks | Letstute; Author: Let'stute;https://www.youtube.com/watch?v=YmDnGcol-gs;License: Standard YouTube License, CC-BY
Introduction to Polynomials; Author: Professor Dave Explains;https://www.youtube.com/watch?v=nPPNgin7W7Y;License: Standard Youtube License