Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

producing a directed edges from a data frame

1 vue (au cours des 30 derniers jours)
fereshteh izadi
fereshteh izadi le 14 Jan 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
hi, I have a data frame as I attached, with below code I got an adjacency matrix
fid = fopen('Ara_GoldST.txt', 'rt');
datacell = textscan(fid, '%s%s%d', 'HeaderLines', 1);
fclose(fid);
TFLocus = datacell{1};
TargetLocus = datacell{2};
all_locus = unique([TFLocus; TargetLocus]);
num_locus = length(all_locus);
[~, TFidx] = ismember(TFLocus, all_locus);
[~, Targidx] = ismember(TargetLocus, all_locus);
adj_matrix = accumarray([TFidx(:), Targidx(:)], 1, [num_locus, num_locus]);
adj_matrix = adj_matrix > 0;
csvwrite('my.txt', adj_matrix);
my adjacency matrix seems contain underacted edges please someone help me to have an adjacency matrix contains only 0 and 1 with directed edge I need your kindly helps thanks a lot

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by