Subscripting a table using linear indexing (one subscript) or multidimensional indexing (three or more subscripts) is not supported.
4 次查看(过去 30 天)
显示 更早的评论
hugo monstans thurler dos santos
2021-8-7
评论: hugo monstans thurler dos santos
2021-8-7
I try run this code for training and test but it doesn't work.
BOP = readtable('auxiliary_equipment.csv');
head(BOP)
%%
rng('default') % To make sure the results are repeatable
numEnsemble = size(BOP);
numFold = 2;
cv = cvpartition(numEnsemble, 'KFold', numFold);
trainData = BOP(training(cv, 1));
validationData = BOP(test(cv, 1));
Subscripting a table using linear indexing (one subscript) or
multidimensional indexing (three or more subscripts) is not supported. Use a
row subscript and a variable subscript.
0 个评论
采纳的回答
Walter Roberson
2021-8-7
trainData = BOP(training(cv, 1),:);
validationData = BOP(test(cv, 1),:);
I suspect you are going to fail after that, however. Perhaps you need to replace readtable() with readmatrix()
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!