Creating a matrix by taking shifted copies of a given vector v as columns - MATLAB Cody - MATLAB Central

Problem 59668. Creating a matrix by taking shifted copies of a given vector v as columns

Difficulty:Rate
This problem is the same as the problem 761 except that here we are testing it for any given vector ; a row or column vector. This is since in the mentionned problem it was tested only on row's vectors.
Example :
  • If v = [1 2 3 4];
1 2 3 4
out-> [1 4 3 2;2 1 4 3;3 2 1 4;4 3 2 1]
1 4 3 2
2 1 4 3
3 2 1 4
4 3 2 1
  • If v = [1 2 3 4 5 6]';
1
2
3
4
5
6
out-> [1 6 5 4 3 2;2 1 6 5 4 3;3 2 1 6 5 4;4 3 2 1 6 5;5 4 3 2 1 6;6 5 4 3 2 1]
1 6 5 4 3 2
2 1 6 5 4 3
3 2 1 6 5 4
4 3 2 1 6 5
5 4 3 2 1 6
6 5 4 3 2 1

Solution Stats

36.36% Correct | 63.64% Incorrect
Last Solution submitted on Jan 27, 2025

Problem Comments

Solution Comments

Show comments
Primes and Rough Numbers, Basic ideas
What is a rough number? What can they be used...
2
4

Problem Recent Solvers11

Suggested Problems

Community Treasure Hunt

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

Start Hunting!
Go to top of page