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
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

Use of logical vector: Determine how many elements in the vector vec were greater than 5, the sum function can be used on the resulting vector isg: >> sum(isg) ans =

Built in recursive function in MATLAB: We have seen that the built-in function in MATLAB to compute factorials, termed as the factorial and we know how to implement the iterat

Illustration of Writing variables to a file: For illustration, in the below session in the Command Window, 3 variables are generated; these are then exhibited using who. Then,

Example of Recursive functions: This definition is recursive as a factorial is defined in terms of the other factorial. There are two parts to any recursive definition: the co

Illustration of nested function: The output arguments are distinct from variables. The scope of an output argument is merely the nested function; and it cannot be used in the

Illustration of Variance For illustration, for the vector [4, 6, 1, 5], there are n = 4 values therefore n - 1 is 3. The mean of this data set is also 4. The variance will be

Illustration of Standard Deviation The less spread out the numbers are, therefore smaller the standard deviation will be, as it is a way of determining the spread of the data.

Illustration of Logical vectors: Calling the function appears to return similar vector as simply vec > 5, and summing the result still works to determine how many elements wer

User input in the while loop: Here is an illustration of running this script: >> readonenum Enter a positive number: -5 Invalid! Enter a positive number: -2.2