if mod(x,2)==0
a = eye(x);
b = fliplr(a);
c= a+b;
else
a = eye(x);
b = fliplr(a);
c= a+b;
c(round(x/2),round(x/2)) = 1;
end
I am getting the right solution on software ... here it is failing ... please help me
solution is in c, output is in y which doesn't exist in workspace.
2522 Solvers
Project Euler: Problem 1, Multiples of 3 and 5
1525 Solvers
Back to basics 20 - singleton dimensions
255 Solvers
Matrix indexing with two vectors of indices
491 Solvers
Flip the vector from right to left
2840 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!