how to create and store a matrix from a dataset comprising of certain rows from the dataset.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Apurva Jariwala
am 27 Feb. 2019
Kommentiert: Apurva Jariwala
am 27 Feb. 2019
Need to create a matrix from a dataset that selects certain rows depending on whether a given condition is fulfilled. For eg, from the IRIS dataset, create a matrix comprising of first 30 samples for each class.
0 Kommentare
Akzeptierte Antwort
KSSV
am 27 Feb. 2019
load iris.dat
setosa = iris((iris(:,5)==1),:); % data for setosa
versicolor = iris((iris(:,5)==2),:); % data for versicolor
virginica = iris((iris(:,5)==3),:); % data for virginica
obsv_n = size(iris, 1); % total number of observations
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Statistics and Machine Learning Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!