how to convert a [1,a,a] array in a [a,a] array?
显示 更早的评论
I'd like to make a crosssection in a 3D array using surf(Array(1, : , : )) kindish fonctions but Array(1, : , : ) outputs a 3D array and surf() needs a 2D array.
Is there a simple function to do it or must i create a new variable to store Array(1, : , : )
Thank you, Marc
采纳的回答
更多回答(1 个)
Joseph Cheng
2014-4-2
0 个投票
the function squeeze() should do the trick, it should return an array with the same elements your starting one but with all the singleton dimensions removed.
类别
在 帮助中心 和 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!