MATLAB: How to find max and min value from .mat file and save it to an other array

.mat filearraymaxminsort

for i=1:10
j(i)=i*0.5:
end
j = sort( j );
save('j.mat', 'j');
how can i find the max and min value from j.mat and save it to an other array?

Best Answer

S = load('j.mat', 'j');
minmax = [min(S.j) max(S.j)];
save('jminmax.mat', minmax);