it doesn't work .so,what is the problem?
显示 更早的评论
function w= flip_it(v)
w = v(end:-1:1);
end
2 个评论
Matt J
2017-12-24
It does work, but I can't see why you don't just use the flip() command provided by MATLAB.
sagar sarwar
2017-12-24
回答(1 个)
Star Strider
2017-12-24
You did not say what the problem actually is. My guess is that you are not calling it correctly. You have to have ‘v’ in your workspace, then call your function as:
v = some_vector;
w = flip_it(v)
类别
在 帮助中心 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!