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
Hi, I need to make sure I have drafted a thorough analysis, so please answer the following questions. Based on the data in the attached image, develop a regression model to forecast the average sales of football magazines for each of the seven home games in the upcoming season (Year 10). That is, you should construct a single regression model and use it to estimate the average demand for the seven home games in Year 10. In addition to the variables provided, you may create new variables based on these variables or based on observations of your analysis. Be sure to provide a thorough analysis of your final model (residual diagnostics) and provide assessments of its accuracy. What insights are available based on your regression model?
I want to make sure that I included all possible variables and observations. There is a considerable amount of data in the images below, but not all of it may be useful for your purposes. Are there variables contained in the file that you would exclude from a forecast model to determine football magazine sales in Year 10? If so, why? Are there particular observations of football magazine sales from previous years that you would exclude from your forecasting model? If so, why?
Stat questions
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