How to define a set of features of a dataset in matlab?
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a dataset CNS with the size nxm n instances and m features(columns), I wanted to write codes to collect all the features of the data in a set or maybe in a vector (F):
F=F1,F2,F3,....,Fm
and then I want to say that the set E is equal to the set F, It means all the elements in F will be put in the set E to use E in the next step, and also I want to say that S is an empty set initially, then I used two for loops to compute the distance between each columns of the data and calculated the average of thses values,
and I used min function to obtain the index of the minimum then I removed It from F and put the result in E.
clc;
clear;
close all;
tic
load CNS.mat
data=CNS;
[n,m]=size(data);
for c=1:m
F(:,c)=data(:,c);
end
E=F;
S=[];
for g=1:m-1
for h=g+1:m-1
t(g,h)=fDiceaDist(data(:,g),data(:,h));
b=sum(t)/(m-1);
end
end
[mn,indexn]=min(b);
E=setdiff(F,indexn);
I attach the CNS, fDiceaDist function.
by continueing the program, when I run the codes, It never stops.
I'll be vary grateful to have your opinions If these codes are true in matlab. Thank you very much
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!