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

1 次查看(过去 30 天)
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',' ')

回答(1 个)

Matt J
Matt J 2020-2-18
编辑:Matt J 2020-2-18
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 个评论
fadams18
fadams18 2020-2-18
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 2020-2-18
I suggest you attach newAS in a .mat file, so we can try to reproduce what you see.

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by