code is showing error with some inputs
이전 댓글 표시
function w=flip_it(v)
m=size(v)
w=v(end:-1:v(1,1));
end
댓글 수: 3
James Tursa
2018년 4월 11일
Is this supposed to work on vectors and matrices and multi-dimensional arrays?
Guillaume
2018년 4월 11일
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
2018년 4월 13일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!