title: How do I make the output-large data file-concise matlab
body: <p>I have a large data input file (50,000 lines); the answers from the data are okay-- min, max, mean, std,-- but I need for the output to come out in a table. I have the code for the solar minimum and the solar maximum but how do I get them to be displayed side-by-side in a helpful way? Here's my code to display the results, but how do I manipulate the results side-by-side, for each year? </p>
  
  <pre><code>%this is the solar maximum year
  N = 100;
  solarmax = fopen('ACE_magswe_64sec_2000.txt','r+');
  formatSpec = '%*d %*d %*d %*d %*f %f %f %f %f %f %f %f %f';
  
  minNp = [];
  maxNp = [];
  meanNp = [];
  stdNp = [];
  
  minTp = [];
  maxTp = [];
  meanTp = [];
  stdTp = [];
  
  minVx = [];
  maxVx = [];
  meanVx = [];
  stdVx = [];
  
  minVy = [];
  maxVy = [];
  meanVy = [];
  stdVy = [];
  
  minVz = [];
  maxVz = [];
  meanVz = [];
  stdVz = [];
  
  minBx = [];
  maxBx = [];
  meanBx = [];
  stdBx = [];
  
  minBy = [];
  maxBy = [];
  meanBy = [];
  stdBy = [];
  
  minBz = [];
  maxBz = [];
  meanBz = [];
  stdBz = [];
  
  
  while ~feof(solarmax)
      C = textscan(solarmax,formatSpec,N,'HeaderLines',2,'Delimiter','\t');
      Np = cell2mat(C(:,1)); 
      Tp = cell2mat(C(:,2));
      Vx = cell2mat(C(:,3));
      Vy = cell2mat(C(:,4));
      Vz = cell2mat(C(:,5));
      Bx = cell2mat(C(:,6));
      By = cell2mat(C(:,7));
      Bz = cell2mat(C(:,8));
  
  
      Np(Np == -9999.90039) = NaN;
      Tp(Tp == -9999.90039) = NaN;
      Vx(Vx == -9999.90039) = NaN;
      Vy(Vy == -9999.90039) = NaN;
      Vz(Vz == -9999.90039) = NaN;
      Bx(Bx == -9999.90039) = NaN;
      By(By == -9999.90039) = NaN;
      Bz(Bz == -9999.90039) = NaN;
  
      minNp(end+1) = min(Np);
      maxNp(end+1) = max(Np);
      meanNp(end+1) = mean(Np);
      stdNp(end+1) = std(Np);
  
      minTp(end+1) = min(Tp);
      maxTp(end+1) = max(Tp);
      meanTp(end+1) = mean(Tp);
      stdTp(end+1) = std(Tp);
  
      minVx(end+1) = min(Vx);
      maxVx(end+1) = max(Vx);
      meanVx(end+1) = mean(Vx);
      stdVx(end+1) = std(Vx);
  
      minVy(end+1) = min(Vy);
      maxVy(end+1) = min(Vy);
      meanVy(end+1) = mean(Vy);
      stdVy(end+1) = std(Vy);
  
      minVz(end+1) = min(Vz);
      maxVz(end+1) = max(Vz);
      meanVz(end+1) = mean(Vz);
      stdVz(end+1) = std(Vz);
  
      minBx(end+1) = min(Bx);
      maxBx(end+1) = max(Bx);
      meanBx(end+1) = mean(Bx);
      stdBx(end+1) = std(Bx);
  
      minBy(end+1) = min(By);
      maxBy(end+1) = max(By);
      meanBy(end+1) = mean(By);
      stdBy(end+1) = std(By);
  
      minBz(end+1) = min(Bz);
      maxBz(end+1) = max(Bz);
      meanBz(end+1) = mean(Bz);
      stdBz(end+1) = std(Bz);
  
  end
  fclose(solarmax);
  
  nanmin(minNp);
  nanmax(maxNp);
  nanmean(meanNp);
  nanstd(stdNp);
  
  nanmin(minTp);
  nanmax(maxTp);
  nanmean(meanTp);
  nanstd(stdTp);
  
  nanmin(minVx);
  nanmax(maxVx);
  nanmean(meanVx);
  nanstd(stdVx);
  
  nanmin(minVy);
  nanmax(maxVy);
  nanmean(meanVy);
  nanstd(stdVy);
  
  nanmin(minVz);
  nanmax(maxVz);
  nanmean(meanVz);
  nanstd(stdVz);
  
  nanmin(minBx);
  nanmax(maxBx);
  nanmean(meanBx);
  nanstd(stdBx);
  
  nanmin(minBy);
  nanmax(maxBy);
  nanmean(meanBy);
  nanstd(stdBy);
  
  nanmin(minBz);
  nanmax(maxBz);
  nanmean(meanBz);
  nanstd(stdBz);
  
  
  %this is the solar minimum year
  N = 100;
  solarmin = fopen('ACE_magswe_64sec_2008.txt','r+');
  formatSpec = '%*d %*d %*d %*d %*f %f %f %f %f %f %f %f %f %*f %*f %*f %*f %*f';
  
  minNp1 = [];
  maxNp1 = [];
  meanNp1 = [];
  stdNp1 = [];
  
  minTp1 = [];
  maxTp1 = [];
  meanTp1 = [];
  stdTp1 = [];
  
  minVx1 = [];
  maxVx1 = [];
  meanVx1 = [];
  stdVx1 = [];
  
  minVy1 = [];
  maxVy1 = [];
  meanVy1 = [];
  stdVy1 = [];
  
  minVz1 = [];
  maxVz1 = [];
  meanVz1 = [];
  stdVz1 = [];
  
  minBx1 = [];
  maxBx1 = [];
  meanBx1 = [];
  stdBx1 = [];
  
  minBy1 = [];
  maxBy1 = [];
  meanBy1 = [];
  stdBy1 = [];
  
  minBz1 = [];
  maxBz1 = [];
  meanBz1 = [];
  stdBz1 = [];
  
  
  while ~feof(solarmin)
      B = textscan(solarmin,formatSpec,N,'HeaderLines',2,'Delimiter','\t');
      Np1 = cell2mat(B(:,1)); 
      Tp1 = cell2mat(B(:,2));
      Vx1 = cell2mat(B(:,3));
      Vy1 = cell2mat(B(:,4));
      Vz1 = cell2mat(B(:,5));
      Bx1 = cell2mat(B(:,6));
      By1 = cell2mat(B(:,7));
      Bz1 = cell2mat(B(:,8));
  
      Np1(Np1 == -9999.90) = NaN;
      Tp1(Tp1 == -9999.90) = NaN;
      Vx1(Vx1 == -9999.90) = NaN;
      Vy1(Vy1 == -9999.90) = NaN;
      Vz1(Vz1 == -9999.90) = NaN;
      Bx1(Bx1 == -9999.90) = NaN;
      By1(By1 == -9999.90) = NaN;
      Bz1(Bz1 == -9999.90) = NaN;
  
      minNp1(end+1) = min(Np1);
      maxNp1(end+1) = max(Np1);
      meanNp1(end+1) = mean(Np1);
      stdNp1(end+1) = std(Np1);
  
      minTp1(end+1) = min(Tp1);
      maxTp1(end+1) = max(Tp1);
      meanTp1(end+1) = mean(Tp1);
      stdTp1(end+1) = std(Tp1);
  
      minVx1(end+1) = min(Vx1);
      maxVx1(end+1) = max(Vx1);
      meanVx1(end+1) = mean(Vx1);
      stdVx1(end+1) = std(Vx1);
  
      minVy1(end+1) = min(Vy1);
      maxVy1(end+1) = max(Vy1);
      meanVy1(end+1) = mean(Vy1);
      stdVy1(end+1) = std(Vy1);
  
      minVz1(end+1) = min(Vz1);
      maxVz1(end+1) = max(Vz1);
      meanVz1(end+1) = mean(Vz1);
      stdVz1(end+1) = std(Vz1);
  
      minBx1(end+1) = min(Bx1);
      maxBx1(end+1) = max(Bx1);
      meanBx1(end+1) = mean(Bx1);
      stdBx1(end+1) = std(Bx1);
  
      minBy1(end+1) = min(By1);
      maxBy1(end+1) = max(By1);
      meanBy1(end+1) = mean(By1);
      stdBy1(end+1) = std(By1);
  
      minBz1(end+1) = min(Bz1);
      maxBz1(end+1) = max(Bz1);
      meanBz1(end+1) = mean(Bz1);
      stdBz1(end+1) = std(Bz1);
  
  
  end
  fclose(solarmin);
  
  nanmin(minNp1);
  nanmax(maxNp1);
  nanmean(meanNp1);
  nanstd(stdNp1);
  
  nanmin(minTp1);
  nanmax(maxTp1);
  nanmean(meanTp1);
  nanstd(stdTp1);
  
  nanmin(minVx1);
  nanmax(maxVx1);
  nanmean(meanVx1);
  nanstd(stdVx1);
  
  nanmin(minVy1);
  nanmax(maxVy1);
  nanmean(meanVy1);
  nanstd(stdVy1);
  
  nanmin(minVz1);
  nanmax(maxVz1);
  nanmean(meanVz1);
  nanstd(stdVz1);
  
  nanmin(minBx1);
  nanmax(maxBx1);
  nanmean(meanBx1);
  nanstd(stdBx1);
  
  nanmin(minBy1);
  nanmax(maxBy1);
  nanmean(meanBy1);
  nanstd(stdBy1);
  
  nanmin(minBz1);
  nanmax(maxBz1);
  nanmean(meanBz1);
  nanstd(stdBz1);
  </code></pre>