Matlab, Fourth Edition: A Practical Introduction to Programming and Problem Solving
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
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, Fourth Edition: 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
1.  Define probability:   2.  Define statistics:
Results of tossing a coin four times: H, H, H, H How many times is the Coin expected to come up heads? How did you determine this number?     Calculate the % deviation.       Can these results be used to conclude that a coin is not fair? Why or why not?
Cycles to failure Position in ascending order 0.5 f(x)) (x;) Problem 44 Marsha, a renowned cake scientist, is trying to determine how long different cakes can survive intense fork attacks before collapsing into crumbs. To simulate real-world cake consumption, she designs a test where cakes are subjected to repeated fork stabs and bites, mimicking the brutal reality of birthday parties. After rigorous testing, Marsha records 10 observations of how many stabs each cake endured before structural failure. Construct P-P plots for (a.) a normal distribution, (b.) a lognormal distribution, and (c.) a Weibull distribution (using the information included in the table below). Which distribution seems to be the best model for the cycles to failure for this material? Explain your answer in detail. Observation Empirical cumulative Probability distribution Cumulative distribution Inverse of cumulative distribution F-1 (-0.5) F(x)) (S) n 4 3 1 0.05 9 5 2 0.15 7 7 3 0.25 1 10 4 0.35 3 12 5 0.45 Normal…
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
Text book image
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
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