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
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.

댓글 수: 2

marc
marc 2014년 4월 2일
Thank you very much but Walter was faster.
He always is. I need to stop writing paragraphs

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

질문:

2014년 4월 2일

댓글:

2014년 4월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by