Index vector, MATLAB in Statistics

Assignment Help:

Index vector:

The index vector is then used as the indices for original vector. To get grades vector in ascending order, the indices used would be grades (2), grades (5), and so forth. By using the index vector to complete this, grades (grade_index(1)) would be the minimum grade, 70, and grades (grade_index(2)) would be the second lowest grade. In common, grades (grade_index(i)) would be the ith lowest grade. To generate these in MATLAB:

 

>> grades = [85 70 100 95 80 91];

>> grade_index = [2 5 1 6 4 3];

>> grades(grade_index)

ans =

70 80 85 91 95 100

 

 

 


Related Discussions:- Index vector

Example of nested functions, Example of Nested functions: For illustra...

Example of Nested functions: For illustration, the function below computes and returns the volume of a cube. Three arguments are then passed to it, for the width and length of

Lower level file i/o functions, Lower Level File I/O Functions: Whenev...

Lower Level File I/O Functions: Whenever reading from data file, as long as the data in the file is "regular" the load function works-in another words, the similar type of dat

Example of functions which complete a task, Example of Functions which comp...

Example of Functions which complete a task: For illustration, the function below just prints the number arguments passed to it in a sentence format: As this function i

Example of core objects, Example of Core objects: The one core graphic...

Example of Core objects: The one core graphics object is a line that is also what the plot function produces. Here is an illustration of generating a line object, altering som

Execution of persistent variables, Execution of persistent variables: ...

Execution of persistent variables: The functions can also be called from the script or from the Command Window, as shown here. For illustration, the functions are called first

If statement - matlab programming, The IF Statement: The if statement ...

The IF Statement: The if statement selects whether or not the other statement, or group of statements, is executed. The common form of the if statement is as shown below: i

Rectangle - graphics objects, Rectangle - graphics objects: The other ...

Rectangle - graphics objects: The other core graphics object is the rectangle that can have curvature added to it (!!). Merely calling the function rectangle without any argum

Illustration of median, Illustration of Median When the vector is not i...

Illustration of Median When the vector is not in sorted order to start with, the median function will still return the right answer (it will sort the vector automatically). For

Illustrations of sequential search, Illustrations of Sequential search: ...

Illustrations of Sequential search: The two illustrations of calling such function is as shown below: >> values = [85 70 100 95 80 91]; >> key = 95; >> seqsearch

Example of vectorizing, Example of Vectorizing: Likewise, for an opera...

Example of Vectorizing: Likewise, for an operation on a matrix, a nested loop would be needed; for illustration, supposing a matrix variable mat: [r c] = size(mat); for

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd