Effacer les filtres
Effacer les filtres

index matrix exceeds dimensions ?! svm

1 vue (au cours des 30 derniers jours)
Kamal Ebrahimi
Kamal Ebrahimi le 2 Déc 2018
Hello , i'm new to matlab trying to write simpler code based on svm fisheriris
i'm writing for simple data whcih is phone detector by having 12 phone as a data.
i'm gettig error regarding dimesnsion in last 4 lines of my code ,and i don't see my index matrix has any problem!!! i'll be grateful if someone helps
%%prepare data set
load pashmak
species_num = grp2idx(species); % converting data phone type to number set
X=meas(1:12.); y=species_num(1:12.);
%writing code to create train data data
trainx=(200:0.5:450) ;
x=cell(1,100);
for j=1:100
x{1,j}=trainx(randi([1 numel(trainx)],1));
end
cell2mat(x) % 100 test data has been made
trainy=(1:1:12) ;
yb=cell(1,100);
for j=1:100
yb{1,j}=trainy(randi([1 numel(trainy)],1));
end
cell2mat(yb) % 100 test data has been made
ran=randperm(100);
X_train = x(ran(1:80),:);
y_train = yb(ran(1:80),:);
X_test = x(ran(81:end),:);
y_test = yb(ran(81:end),:);

Réponses (0)

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by