필터 지우기
필터 지우기

how to extract subset from dataset?

조회 수: 2 (최근 30일)
mahmood aljamal
mahmood aljamal 2022년 12월 7일
댓글: Arif Hoq 2022년 12월 7일
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'

채택된 답변

Arif Hoq
Arif Hoq 2022년 12월 7일
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
mahmood aljamal
mahmood aljamal 2022년 12월 7일
I got this error
Error using load
Unable to read file 'output.mat'. No such file or directory.
Arif Hoq
Arif Hoq 2022년 12월 7일
check the 'output.mat' file in your matlab directory.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by