code is showing error with some inputs
Afficher commentaires plus anciens
function w=flip_it(v)
m=size(v)
w=v(end:-1:v(1,1));
end
3 commentaires
James Tursa
le 11 Avr 2018
Is this supposed to work on vectors and matrices and multi-dimensional arrays?
Guillaume
le 11 Avr 2018
And what is the point of
m=size(v)
which is completely unused.
In any case, there are many inputs with which the given work will not work, something as simple as v=0 will error, but since there's no explanation of what the code should do how can we tell what is a coding error.
Ashay Shukla
le 13 Avr 2018
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!