MATLAB: A Practical Introduction to Programming and Problem Solving
MATLAB: A Practical Introduction to Programming and Problem Solving
5th Edition
ISBN: 9780128163450
Author: ATTAWAY
Publisher: ELSEVIER
bartleby

Concept explainers

bartleby

Videos

Question
Book Icon
Chapter 12, Problem 12.1P
To determine

To create:

A file that has two lines with n numbers in each and use subplot to show the barh and stacked bar charts side by side.

Expert Solution & Answer
Check Mark

Answer to Problem 12.1P

Solution:

The script file is,

l = load('ponits.dat');

%load the points data file.

subplot(2, 1, 1)

%by using subplot show the bar graph and stacked bar graph side by side.

barh(l);

%plot the bar graph.

xlabel('Values');

%label the x axis as values.

ylabel('Groups');

%label the y axis as values.

subplot(2, 1, 2)

bar(l,'stacked');

%plot the stacked bar.

xlabel('Groups');

%label the x axis as groups.

ylabel('Values');

%label the y axis as values.

Explanation of Solution

Consider, the vectors are,

x=[240536292021]

y=37813141813

MATLAB Code:

l = load('ponits.dat');

%load the points data file.

subplot(2, 1, 1)

%by using subplot show the bar graph and stacked bar graph side by side.

barh(l);

%plot the bar graph.

xlabel('Values');

%label the x axis as values.

ylabel('Groups');

%label the y axis as values.

subplot(2, 1, 2)

bar(l,'stacked');

%plot the stacked bar.

xlabel('Groups');

%label the x axis as groups.

ylabel('Values');

%label the y axis as values.

Save the MATLAB files with name, chapter12_54793_12_1P.m in the current folder. Execute the file by typing the name at the command window to generate output.

Result:

The plot is,

MATLAB: A Practical Introduction to Programming and Problem Solving, Chapter 12, Problem 12.1P

Therefore, the result is stated above.

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
Customers experiencing technical difficulty with their Internet cable service may call an 800 number for technical support. It takes the technician between 30 seconds and 11 minutes to resolve the problem. The distribution of this support time follows the uniform distribution. Required: a. What are the values for a and b in minutes? Note: Do not round your intermediate calculations. Round your answers to 1 decimal place. b-1. What is the mean time to resolve the problem? b-2. What is the standard deviation of the time? c. What percent of the problems take more than 5 minutes to resolve? d. Suppose we wish to find the middle 50% of the problem-solving times. What are the end points of these two times?
Exercise 6-6 (Algo) (LO6-3)   The director of admissions at Kinzua University in Nova Scotia estimated the distribution of student admissions for the fall semester on the basis of past experience. Admissions Probability 1,100 0.5 1,400 0.4 1,300 0.1     Click here for the Excel Data File   Required: What is the expected number of admissions for the fall semester?       Compute the variance and the standard deviation of the number of admissions. Note: Round your standard deviation to 2 decimal places.
1. Find the mean of the x-values (x-bar) and the mean of the y-values (y-bar) and write/label each here: 2. Label the second row in the table using proper notation; then, complete the table. In the fifth and sixth columns, show the 'products' of what you're multiplying, as well as the answers. X y x minus x-bar y minus y-bar (x minus x-bar)(y minus y-bar) (x minus x-bar)^2 xy 16 20 34 4-2 5 2 3. Write the sums that represents Sxx and Sxy in the table, at the bottom of their respective columns. 4. Find the slope of the Regression line: bi = (simplify your answer) 5. Find the y-intercept of the Regression line, and then write the equation of the Regression line. Show your work. Then, BOX your final answer. Express your line as "y-hat equals...
Knowledge Booster
Background pattern image
Statistics
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
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Glencoe Algebra 1, Student Edition, 9780079039897...
Algebra
ISBN:9780079039897
Author:Carter
Publisher:McGraw Hill
Text book image
Trigonometry (MindTap Course List)
Trigonometry
ISBN:9781337278461
Author:Ron Larson
Publisher:Cengage Learning
Text book image
College Algebra
Algebra
ISBN:9781337282291
Author:Ron Larson
Publisher:Cengage Learning
Text book image
Holt Mcdougal Larson Pre-algebra: Student Edition...
Algebra
ISBN:9780547587776
Author:HOLT MCDOUGAL
Publisher:HOLT MCDOUGAL
Text book image
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
Matrix Operations Full Length; Author: ProfRobBob;https://www.youtube.com/watch?v=K5BLNZw7UeU;License: Standard YouTube License, CC-BY
Intro to Matrices; Author: The Organic Chemistry Tutor;https://www.youtube.com/watch?v=yRwQ7A6jVLk;License: Standard YouTube License, CC-BY