This solution is outdated. To rescore this solution, sign in.
Why is this not working please?
a = ones(n,n);
for i = 1:n^2;
a(i) = i;
end
a = a'
I've tried this in school and it worked fine... :O Could you please help and explain? :)
Look closer at the requirements. Even rows should be flipped, such that their values are in descending order when reading from left-to-right.
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
n = 5;
a = [ 1 2 3 4 5;
10 9 8 7 6;
11 12 13 14 15;
20 19 18 17 16;
21 22 23 24 25];
assert(isequal(a,back_and_forth(n)));
|
Find the sum of all the numbers of the input vector
31956 Solvers
4106 Solvers
Count from 0 to N^M in base N.
220 Solvers
519 Solvers
251 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!