Why am I not getting the table named SelectedTable as an output? How to rectify such errors in MATLAB?
Show older comments
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
Answers (2)
Yogananda Jeppu
on 11 Nov 2017
0 votes
Could you explain what you are trying to do?
1 Comment
surabhi sachdeva
on 11 Nov 2017
Edited: surabhi sachdeva
on 11 Nov 2017
Image Analyst
on 11 Nov 2017
0 votes
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 Comment
surabhi sachdeva
on 11 Nov 2017
Edited: surabhi sachdeva
on 11 Nov 2017
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!