![Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving](https://www.bartleby.com/isbn_cover_images/9780128045251/9780128045251_largeCoverImage.gif)
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
![Check Mark](/static/check-mark.png)
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
08:34
◄ Classroom
07:59
Probs. 5-32/33
D
ا.
89
5-34. Determine the horizontal and vertical components
of reaction at the pin A and the normal force at the smooth
peg B on the member.
A
0,4 m
0.4 m
Prob. 5-34
F=600 N
fr
th
ar
0.
163586
5-37. The wooden plank resting between the buildings
deflects slightly when it supports the 50-kg boy. This
deflection causes a triangular distribution of load at its ends.
having maximum intensities of w, and wg. Determine w
and wg. each measured in N/m. when the boy is standing
3 m from one end as shown. Neglect the mass of the plank.
0.45 m
3 m
Examine the Variables: Carefully review and note the names of all variables in the dataset. Examples of these variables include:
Mileage (mpg)
Number of Cylinders (cyl)
Displacement (disp)
Horsepower (hp)
Research: Google to understand these variables.
Statistical Analysis: Select mpg variable, and perform the following statistical tests. Once you are done with these tests using mpg variable, repeat the same with hp
Mean
Median
First Quartile (Q1)
Second Quartile (Q2)
Third Quartile (Q3)
Fourth Quartile (Q4)
10th Percentile
70th Percentile
Skewness
Kurtosis
Document Your Results:
In RStudio: Before running each statistical test, provide a heading in the format shown at the bottom. “# Mean of mileage – Your name’s command”
In Microsoft Word: Once you've completed all tests, take a screenshot of your results in RStudio and paste it into a Microsoft Word document. Make sure that snapshots are very clear. You will need multiple snapshots. Also transfer these results to the…
Examine the Variables: Carefully review and note the names of all variables in the dataset. Examples of these variables include:
Mileage (mpg)
Number of Cylinders (cyl)
Displacement (disp)
Horsepower (hp)
Research: Google to understand these variables.
Statistical Analysis: Select mpg variable, and perform the following statistical tests. Once you are done with these tests using mpg variable, repeat the same with hp
Mean
Median
First Quartile (Q1)
Second Quartile (Q2)
Third Quartile (Q3)
Fourth Quartile (Q4)
10th Percentile
70th Percentile
Skewness
Kurtosis
Document Your Results:
In RStudio: Before running each statistical test, provide a heading in the format shown at the bottom. “# Mean of mileage – Your name’s command”
In Microsoft Word: Once you've completed all tests, take a screenshot of your results in RStudio and paste it into a Microsoft Word document. Make sure that snapshots are very clear. You will need multiple snapshots. Also transfer these results to the…
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
- Examine the Variables: Carefully review and note the names of all variables in the dataset. Examples of these variables include: Mileage (mpg) Number of Cylinders (cyl) Displacement (disp) Horsepower (hp) Research: Google to understand these variables. Statistical Analysis: Select mpg variable, and perform the following statistical tests. Once you are done with these tests using mpg variable, repeat the same with hp Mean Median First Quartile (Q1) Second Quartile (Q2) Third Quartile (Q3) Fourth Quartile (Q4) 10th Percentile 70th Percentile Skewness Kurtosis Document Your Results: In RStudio: Before running each statistical test, provide a heading in the format shown at the bottom. “# Mean of mileage – Your name’s command” In Microsoft Word: Once you've completed all tests, take a screenshot of your results in RStudio and paste it into a Microsoft Word document. Make sure that snapshots are very clear. You will need multiple snapshots. Also transfer these results to the…arrow_forward2 (VaR and ES) Suppose X1 are independent. Prove that ~ Unif[-0.5, 0.5] and X2 VaRa (X1X2) < VaRa(X1) + VaRa (X2). ~ Unif[-0.5, 0.5]arrow_forward8 (Correlation and Diversification) Assume we have two stocks, A and B, show that a particular combination of the two stocks produce a risk-free portfolio when the correlation between the return of A and B is -1.arrow_forward
- 9 (Portfolio allocation) Suppose R₁ and R2 are returns of 2 assets and with expected return and variance respectively r₁ and 72 and variance-covariance σ2, 0%½ and σ12. Find −∞ ≤ w ≤ ∞ such that the portfolio wR₁ + (1 - w) R₂ has the smallest risk.arrow_forward7 (Multivariate random variable) Suppose X, €1, €2, €3 are IID N(0, 1) and Y2 Y₁ = 0.2 0.8X + €1, Y₂ = 0.3 +0.7X+ €2, Y3 = 0.2 + 0.9X + €3. = (In models like this, X is called the common factors of Y₁, Y₂, Y3.) Y = (Y1, Y2, Y3). (a) Find E(Y) and cov(Y). (b) What can you observe from cov(Y). Writearrow_forward1 (VaR and ES) Suppose X ~ f(x) with 1+x, if 0> x > −1 f(x) = 1−x if 1 x > 0 Find VaRo.05 (X) and ES0.05 (X).arrow_forward
- Joy is making Christmas gifts. She has 6 1/12 feet of yarn and will need 4 1/4 to complete our project. How much yarn will she have left over compute this solution in two different ways arrow_forwardSolve for X. Explain each step. 2^2x • 2^-4=8arrow_forwardOne hundred people were surveyed, and one question pertained to their educational background. The results of this question and their genders are given in the following table. Female (F) Male (F′) Total College degree (D) 30 20 50 No college degree (D′) 30 20 50 Total 60 40 100 If a person is selected at random from those surveyed, find the probability of each of the following events.1. The person is female or has a college degree. Answer: equation editor Equation Editor 2. The person is male or does not have a college degree. Answer: equation editor Equation Editor 3. The person is female or does not have a college degree.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 Learning
![Text book image](https://www.bartleby.com/isbn_cover_images/9780547587776/9780547587776_smallCoverImage.jpg)
Holt Mcdougal Larson Pre-algebra: Student Edition...
Algebra
ISBN:9780547587776
Author:HOLT MCDOUGAL
Publisher:HOLT MCDOUGAL
![Text book image](https://www.bartleby.com/isbn_cover_images/9780395977224/9780395977224_smallCoverImage.gif)
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
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337282291/9781337282291_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781305652231/9781305652231_smallCoverImage.gif)
College Algebra (MindTap Course List)
Algebra
ISBN:9781305652231
Author:R. David Gustafson, Jeff Hughes
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