- Are the requested number of elements the same?
- Are the requested dimension values all non-negative integers?
- If there is a missing dimension, calculate this value and make sure it is an integer.
- Can the result be a shared data copy? (e.g., for a full matrix)
- Will the result need to be a deep data copy? (e.g., for a sparse matrix)
- Etc.
View Reshape Function Code
1 次查看(过去 30 天)
显示 更早的评论
I would like to open and view the code for the reshape function, does anyone have a copy?
0 个评论
采纳的回答
James Tursa
2020-6-1
All it basically does is replace the dimensions with the requested dimensions in the internal variable header. There wouldn't be much to see even if you could see the source code for that part. Most of the code is probably for the checking, e.g.,
2 个评论
isamh
2020-9-23
what if I use reshape with negative decimal values? the output shows all the values but shows all negative values as positive.
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!