how to extract subset from dataset?

10 visualizzazioni (ultimi 30 giorni)
mahmood aljamal
mahmood aljamal il 7 Dic 2022
Commentato: Arif Hoq il 7 Dic 2022
Welcome
I have a dataset of type "CSV" named "NF" in which there is a column of type Categorecal named "Attack" and it has five categories: 'Benign', 'Theft', 'DDoS', 'DoS', and 'Reconnaissance' .
I want to extract a new dataset from this dataset "NF" based on the value of the column "Attack" if it is only equal to 'DDoS'

Risposta accettata

Arif Hoq
Arif Hoq il 7 Dic 2022
a=readtable("NF.xlsx");
aa=find(strcmp(a.Attack,'DDoS'));
aaa=a(aa,:)
aaa = 3×5 table
value del dys label Attack _____ ___ ____ _____ ________ 1 43 232 1 {'DDoS'} 3 4 2323 1 {'DDoS'} 34 6 2323 1 {'DDoS'}
  11 Commenti
mahmood aljamal
mahmood aljamal il 7 Dic 2022
I got this error
Error using load
Unable to read file 'output.mat'. No such file or directory.
Arif Hoq
Arif Hoq il 7 Dic 2022
check the 'output.mat' file in your matlab directory.

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by