필터 지우기
필터 지우기

Creating cell within structure

조회 수: 1 (최근 30일)
Samadrita
Samadrita 2013년 7월 11일
I am trying to create a cell array within a structure.
I am trying the syntax (as per the help struct)
..................................................
% get the values to place into structure from excel file
[num, str]=xlsread('InputFile.xlsx','WeightedLookUp');
% Now create the structure from the files
B= struct(str{1,1},[num(:,1)],str{1,2},{str(2:end,2)},...
str{1,3},[num(:,3)],str{1,4},[num(:,4)]);
.........................................
But I still get B =
order: [9x1 double]
tissue: {5x1 cell}
my *desired* result(obtained by manually placing things in structure) is
B =
order: {9x1 cell}
tissue: {9x1 cell}
If anyone could please help me resolve this,it will be very helpful. Thanks
  댓글 수: 2
Azzi Abdelmalek
Azzi Abdelmalek 2013년 7월 11일
Can you give more details about str and num?
Samadrita
Samadrita 2013년 7월 11일
num has values created by reading xlsread and str has the string vales from the same sheet.
whos num
Name Size Bytes Class Attributes
num 9x17 1224 double
and
Name Size Bytes Class Attributes
str 10x17 19360 cell

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by