Covert cell array to array

조회 수: 4 (최근 30일)
Mo H
Mo H 2020년 4월 3일
댓글: Mo H 2020년 4월 3일
Hello,
I have some data stored in a cell array and the size the cell is not known. I want to convert the cell array into array.
Basically, I want to create a for loop that reads the the previous array in the cell, determine it it size, and then store the data in array.
For example,
CellArrar = {[1 5 7;2 6 8],[1 5 8; 2 5 7],[1 8 8]}
Array = [ 1 5 7; 2 6 8;3 5 8; 4 5 7;5 8 8]
Thank you a lot

채택된 답변

Birdman
Birdman 2020년 4월 3일
Something like this?
Array=cell2mat(CellArrar.')
  댓글 수: 3
Birdman
Birdman 2020년 4월 3일
Array(:,1)=1:size(Array,1)
Mo H
Mo H 2020년 4월 3일
Thank you

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by