Find minimum of a 15x100 and return in a vector of 1x100. is this possible?

1 visualización (últimos 30 días)
fadams18
fadams18 el 18 de Feb. de 2020
Editada: Matt J el 18 de Feb. de 2020
I have
i=5 ; nu=150 ;
for j =1:15
load(['output/GC/rank_', int2str(i), '/nu_',int2str(nu),'/NeNMF_GC_', int2str(j), '.mat'], ...
'RRE_AS_V' );
newAS (j,:)= (RRE_AS_V);
end
The variable newAS is 15 x 101 in size. if i do a median it works fine. It returns a 1x101
Median_newAS = median(newAS,1);
However wheni do for min and max it appears the values are swapped when i write to a table
% however for min and max
Min_newAS = min(newAS);
Max_newAS = max(newAS);
I write to a table. but when i examin my min values they look like they are rather the max values. and max values are small
T_AS=table(Min_newAS',Max_newAS',Max_newAS' ,'VariableNames',{'Min_AS','Med_AS','Max_AS'});
namedatfile= ['r_' int2str(i),'_nu_' int2str(nu) '_pass.dat'];
fname = namedatfile;
writetable(T_AS,fname,'Delimiter',' ')

Respuestas (1)

Matt J
Matt J el 18 de Feb. de 2020
Editada: Matt J el 18 de Feb. de 2020
The names of the variables you wrote to the table
Min_AS,Med_AS,Max_AS
are different from the original variable names you showed us,
Median_newAS
Min_newAS
Max_newAS
So, it wouldn't be a surprise if the data you wrote to the table was different from what you computed.
  2 comentarios
fadams18
fadams18 el 18 de Feb. de 2020
Sorry actually they are the same i just wanted to simplify the code here for potential solvers. I have edited the question
Matt J
Matt J el 18 de Feb. de 2020
I suggest you attach newAS in a .mat file, so we can try to reproduce what you see.

Iniciar sesión para comentar.

Categorías

Más información sobre Structures en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by