python的reshape与matlab
时间: 2023-11-04 20:54:19 浏览: 140
的reshape有什么区别?
回答: Python中的reshape函数与Matlab中的reshape函数在填充顺序上有所不同。在Python中,reshape函数按行顺序优先填充数据,而在Matlab中,reshape函数按列顺序优先填充数据。\[2\]例如,在Python中,可以使用numpy的reshape函数来改变数组的形状,如b.reshape(2, -1),其中-1表示自动计算行数或列数。而在Matlab中,可以使用reshape函数来改变数组的形状,但是它会按列顺序优先填充数据。\[1\]所以在使用reshape函数时,需要注意这个区别。
#### 引用[.reference_title]
- *1* *3* [【20211103】【Python/Matlab】Python 中 numpy.reshape() 和 Matlab 中 reshape(mat) 的区别](https://blog.csdn.net/weixin_40583722/article/details/121117435)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [Python 与matlab中 reshape()函数用法的不同](https://blog.csdn.net/weixin_44948010/article/details/129492965)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文
相关推荐


















