It stopped giving me the error and I didn't change anything. It was really weird, I just deleted a file that uses reshape but that it has nothing to do with the function I'm running and it's not even in the same folder. I don't know what happened but it's fine now.
Error using RESHAPE but I'm not using reshape
1 次查看(过去 30 天)
显示 更早的评论
When executing one of my functions I'm getting:
Error using reshape To RESHAPE the number of elements must not change.
But my function doesn't even use reshape, any ideas of what is going on here? I mean, what other MATLAB function am I maybe using incorrectly that could be throwing this error?
5 个评论
Cedric
2013-7-23
I don't think that Jan wanted to suggest that you were lying, but sometimes when we debug code, we check things out by e.g. commenting a few lines at different/random places, and we end up being unable of reproducing the bug when we want to ;-)
采纳的回答
Sean de Wolski
2013-7-22
dbstop if error
Then run your code. This will stop with the debugger on the offending line and you will be able to see what is happening.
1 个评论
per isakson
2013-7-23
Make it a habit to use the debugger. It's good. Here are some links on debugging in Matlab
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Function Creation 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!