필터 지우기
필터 지우기

Why am I not getting the table named SelectedTable as an output? How to rectify such errors in MATLAB?

조회 수: 1 (최근 30일)
i=0:2;
j=0:2;
k=0:2;
l=0:2;
m=0:2;
n=0:2;
A=fullfact([3 3 3 3 3 3])-1;
B = char(A+'0');
states=B;
rownames = states;
prefix = 'T';
varnames = strcat({prefix}, states);
selected=cell(729,729);
  • SelectedTable =cell2dataset(selected, 'VarNames', B, 'ObsNames', B);*
  • *Error using setobsnames (line 29)
NEWNAMES must be a nonempty string or a cell array of nonempty strings. Error in dataset (line 377) a = setobsnames(a,obsnamesArg);**
  • Error in mat2dataset (line 75)d = dataset(vars{:},args{:});*
When I shifted from mat2dataset TO cell2dataset, I still got some error. How to get an error free successful execution so as to get the table?
>> * SelectedTable =cell2dataset(selected, 'VarNames', B, 'ObsNames', B);*
  • *Error using cell2dataset (line 140)
NEWNAMES must be a nonempty string or a cell array of nonempty strings.* *
Kindly help in rectifying the error.
Regards
Surabhi

답변 (2개)

Yogananda Jeppu
Yogananda Jeppu 2017년 11월 11일
Could you explain what you are trying to do?
  댓글 수: 1
surabhi sachdeva
surabhi sachdeva 2017년 11월 11일
편집: surabhi sachdeva 2017년 11월 11일
I am trying to make a transition table named SelectedTable 729X729 in which I have to apply rules and get the values in order to get the state transition rate matrix 729X729 out of it.
I have started writing the code but I am getting struck on how to write the line of code for declaring a table which contains all the 729 values?
i=0:2;
j=0:2;
k=0:2;
l=0:2;
m=0:2;
n=0:2;
A=fullfact([3 3 3 3 3 3])-1;
B = char(A+'0');
states=B;
rownames = states;
prefix = 'T';
varnames = strcat({prefix}, states);
selected=cell(729,729);
  • SelectedTable =cell2dataset(selected, 'VarNames', B, 'ObsNames', B);*
getting error declaring this table/state transition matrix.
Please help if you can.

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


Image Analyst
Image Analyst 2017년 11월 11일
Why are you passing in a cell array of all nulls for selected? Is that supposed to work? Why do you create the variable called varnames when you never use it?
  댓글 수: 1
surabhi sachdeva
surabhi sachdeva 2017년 11월 11일
편집: surabhi sachdeva 2017년 11월 11일
Actually sir,
I am trying to make a transition table named SelectedTable 729X729 in which I have to apply rules and get the values in order to get state transition rate matrix 729X729 out of it.
I have started writing the code but I am getting struck on how to write the line of code for declaring a table which contains all the 729 values?
getting error declaring this table/state transition matrix.
Please help if you can.

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

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by