I don't understand if the smallest element should be the last or the first of the sorted array
Thanks for creating a problem! It's a little ambiguous right now (see @andrea84's comment above). There is more than one answer as currently defined. Could you please clarify it?
Sorry for that, if you have input odd vector the smallest element is on the end, but if u input even vector the smallest element is on the first position.
Find the peak 3n+1 sequence value
Back to basics 8 - Matrix Diagonals
Insert zeros into vector
Generate a random matrix A of (1,-1)
Find the treasures in MATLAB Central and discover how the community can help you!
Select a Web
Choose a web site to get translated content where available and see local events and
offers. Based on
your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country
sites are not optimized for visits from your location.
Contact your local office