Combining cells into a single cell
이전 댓글 표시
Hi there
I have a variable called z in a 9x1 cell. See the picture:

Is ther anyway to combine the cells to one cell like 360<181x1080?
Because when I run my data, z{:} in my code, I got the error "Expected one output from a curly brace or dot indexing expression, but there were 9 results."
So I think I should combine my 9 cells to one so I have one result?
댓글 수: 5
Luna
2018년 12월 28일
What do you mean by < operator in this term: 360<181x1080?
And could you please share your code how do you use z{:} ?
Dou you want to merge all of these double arrays inside your z?
"Is ther anyway to combine the cells to one cell like 360<181x1080?"
Your 9x1 cell array contains double arrays (not cell arrays), so the combined array will also be a double array (not a cell array as you wrote).
Jonas Damsbo
2018년 12월 29일
If z is non-scalar (i.e. has zero or multiple cells) then this syntax will throw an error:
z{:}(:,ny:-1:1);
Do you have a question about the code that you showed us? I notice that the code you show does not use either of the answers that you have been given.
Jonas Damsbo
2018년 12월 29일
편집: Jonas Damsbo
2018년 12월 29일
채택된 답변
추가 답변 (1개)
카테고리
도움말 센터 및 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!