MATLAB: An Introduction with Applications
MATLAB: An Introduction with Applications
5th Edition
ISBN: 9781118629864
Author: Amos Gilat
Publisher: WILEY
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 7, Problem 27P

Write a user-defined function that sorts the elements of a matrix. For the function name and arguments, use B= matrixsort (A), where A is any size (m×n) matrix and B is a matrix of the same size with the elements of A rearranged in descending order column alter column with the (1,1) element the largest and the (m,n) element the smallest. If available, use the user- defined function downsort from the previous problem as a subfunction

within matrixsort.

Test your function on a 4×7 matrix with elements (integers) randomly distributed between -30 and 30. Use MATLAB’s randi function to generate the initial matrix.

Blurred answer
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.
Recommended textbooks for you
Text book image
College Algebra (MindTap Course List)
Algebra
ISBN:9781305652231
Author:R. David Gustafson, Jeff Hughes
Publisher:Cengage Learning
Text book image
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
Text book image
Calculus For The Life Sciences
Calculus
ISBN:9780321964038
Author:GREENWELL, Raymond N., RITCHEY, Nathan P., Lial, Margaret L.
Publisher:Pearson Addison Wesley,
Text book image
Elementary Linear Algebra (MindTap Course List)
Algebra
ISBN:9781305658004
Author:Ron Larson
Publisher:Cengage Learning
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