loading and accessing cell array

I had a Table cell of dimension 6x32x32. I saved it in my folder using save('Table.mat','Table') In another function I loaded it using Table = struct2cell(load('Table.mat')) which resulted in {1x1} cell. Now I am trying to access the original Table{6x32x32} by using "cell2mat(Table)" but I am getting an error
??? Error using ==> cell2mat at 53 Cannot support cell arrays containing cell arrays or objects.
How should I get around this problem.

답변 (1개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 18일

1 개 추천

cell2mat(table{1})

댓글 수: 8

xplore29
xplore29 2013년 6월 18일
I tried doing this but its is changing the original dimensions from 6x32x32 to 16x64x4. Any idea why am i getting this change?
Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 18일
I think the original dimension is 16x64x4
xplore29
xplore29 2013년 6월 18일
To start with FBTable : 1x1 cell = {6x32x32 cell} After FBT = cell2mat(FBTable{1}) gives FBT 16x64x4
Azzi Abdelmalek
Azzi Abdelmalek 2013년 6월 18일
Can you post a sample of your data?
xplore29
xplore29 2013년 6월 18일
Actually I think the real problem is coming from loading the data. I do not understand that why load(.) results into a structure array.The format of the data should remain same after using load(.). Is that correct. If that is the case then why my data gets into s structure format is not comprehendible to me.
If you want your data in non struct format use
load Table
xplore29
xplore29 2013년 6월 19일
That worked. Thank you. But I still have to figure out the difference between load Table and load('Table')
Suppose, your file table contains variables x1,x2 and x3
load table % will load x1,x2 and x3 to your workspace
data=load('table') % will create a struct variable data with fields x1,x2, and x3 . To get your variables
x1=data.x1
x2=data.x2
x3=data.x3

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

카테고리

도움말 센터File Exchange에서 Data Type Conversion에 대해 자세히 알아보기

질문:

2013년 6월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by