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

1 vue (au cours des 30 derniers jours)
fadams18
fadams18 le 18 Fév 2020
Modifié(e) : Matt J le 18 Fév 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',' ')

Réponses (1)

Matt J
Matt J le 18 Fév 2020
Modifié(e) : Matt J le 18 Fév 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 commentaires
fadams18
fadams18 le 18 Fév 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 le 18 Fév 2020
I suggest you attach newAS in a .mat file, so we can try to reproduce what you see.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by