我正在尝试使用以下代码在matlab 12上创建数据集
C = dataset('File', 'zoo.txt', 'VarNames',{'animalname','hair','feathers',...
'eggs','milk','airborne','aquatic','predator','toothed', 'backbone',...
'breathes', 'venomous', 'fins',...
'legs', 'tail','domestic','catsize','type'}, 'Delimiter', ',')但是它显示了使用setvarname(第36行)重复变量名的错误。
数据集/读文件出错(第235行)a=setvarname(a,varNames(:)',[],true,true);
数据集中的错误(第339行)a= readFile(a,fileArg,otherArgs);
有人能帮上忙吗?Here you are the zoo.txt file
发布于 2014-01-11 04:29:51
艾哈迈德
数字列太少,请在末尾添加新列
C = dataset('File', 'zoo.txt', 'VarNames',{'animalname','hair','feathers',...
'eggs','milk','airborne','aquatic','predator','toothed', 'backbone',...
'breathes', 'venomous', 'fins',...
'legs', 'tail','domestic','type','x'}, 'Delimiter', ',')看看x,它对我很管用。
它返回
C=
动物名称毛发羽毛蛋牛奶空中水生‘羚羊’1 0 0 1 0 0低音‘0 0 1 0 0 1’熊‘1 0 0 1 00‘公猪’1 0 0 1 0‘野牛’1 0 0 1 0‘小牛’1 0 0 1 0 0‘鲤鱼’0 0 1 0 0 1
....
https://stackoverflow.com/questions/21053695
复制相似问题