Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

producing a directed edges from a data frame

1 visualización (últimos 30 días)
fereshteh izadi
fereshteh izadi el 14 de En. de 2016
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by