Bar and barh functions - plot functions, MATLAB in Mathematics

bar and barh functions:

For a matrix, the bar and barh functions will group altogether the values in each and every row. The illustration is as shown:

rm = randint(2,4,[1 50])

rm =

 8 19 43 25

35 44 30 45

bar(rm)

gives the plot as shown in the figure.

165_bar and barh functions.jpg

Note that the MATLAB groups altogether the values in the first row and then in the next row. It cycles through colors to differentiate the bars. The 'stack' option will stack instead of grouping the values; therefore the y value presented by the top of the bar is the addition of the values from that row as shown in fgure.

bar(rm,'stack')

2334_bar and barh functions1.png

 

Posted Date: 10/22/2012 1:44:32 AM | Location : United States







Related Discussions:- Bar and barh functions - plot functions, Assignment Help, Ask Question on Bar and barh functions - plot functions, Get Answer, Expert's Help, Bar and barh functions - plot functions Discussions

Write discussion on Bar and barh functions - plot functions
Your posts are moderated
Related Questions
Counting in a While Loop: Whenever it is not known ahead of the time how many values will be entered into the script, it is often essential to count the number of values which

Concatenation: The String concatenation means to join the strings altogether. Of course, as strings are merely vectors of the characters, the technique of concatenating vector

Creating string Variables: The string consists of a few numbers of characters (including, possibly, none). These are the illustrations of the strings: '' 'x' 'ca

Function xlsread - file function: The function xlsread will read from the spreadsheet file. For illustration, to read from file just generated: >> ssnums = xlsread('ranexc

Illustrations of Variable number of output arguments: In the illustrations shown here, the user should actually know the type of the argument in order to establish how many va

Differentiation: The derivative of a function y = f(x) can be written as follows or f  '(x) and is defined as the rate of change of the dependent variable y with respe

Referring to and Modifying the Matrix Elements: To refer to matrix elements, the row and then the column indices are given in parentheses (always the row index initially and t

bar and barh functions: For a matrix, the bar and barh functions will group altogether the values in each and every row. The illustration is as shown: rm = randint(2,4,[1

Nested IF-ELSE statements: The if-else statement is used to select between the two statements. In order to select from more than two statements, the if-else statements can als

Built-in function for Differentiation: The MATLAB has a built-in function, diff that returns the differences between consecutive elements in a vector. For illustration, >>