Help with MATLAB problem

조회 수: 13 (최근 30일)
john doe
john doe 2016년 11월 11일
편집: per isakson 2016년 11월 11일
The problem is listed below. If anyone could provide me some guidance, I would greatly appreciate it, I kind of don't know where to start!
*"Create a new script file called LASTNAME_LAB6_problem4.m. Again, begin by printing both your name and a title at the beginning of code using the DISP command.
A vector is given by
x=[4.5 5 -16.12 21.8 10.1 -16.11 5 14 -3 3 2]
Using conditional statements and loops, write a program that implements “Selection Sort” to rearrange the elements of x in order from the smallest to the largest. Do NOT use MATLAB’s built-in function sort().
Selection Sort Suppose x is an array of n values. We want to sort x in ascending order. That is, x[1] should be the smallest and x[n] should be the largest. The idea of Selection Sort is that we repeatedly find the smallest element in the unsorted part of the array and swap it with the first element in the unsorted part of the array. "*
  댓글 수: 1
Guillaume
Guillaume 2016년 11월 11일
By help you mean "do it for me because I can't be bothered and I'd rather cheat on my assignment"?
Otherwise, you would be asking a specific question about the attempt that you made.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by