title: How to create a matrix in matlab using variables?
body: <p>I have four variables which I created using NetCDF data namely
  height, lat, long and date.
  Now I want to create a single matrix with these variables as a column then I supposed to neglect values containing "NAN" data.</p>
  
  <p>I have done this separately, but I want in a single matrix.
  I have to run this process on multiple files.</p>
  
  <pre><code>for i = 1:length(theFiles)% Loop for each nc-file
      %Select Single cycle
      FileName = theFiles(i).name; 
  
      FullPathName=fullfile(folder_name, FileName); %reading file one by one
      disp(['File selected:', FullPathName])
  
  
      [Height,time,Lat,Long]=read_netcdf(FullPathName);  % Read the selected nc file 
       lattiude=Lat;
       longitude=Long;
  
       B = [Height,time,Lat,Long];   
      end 
  </code></pre>
  
  <p>One more thing, total no. of data is 579X1 all variable but as I remove Nan value from Height, its dimension reduces to 45X1 
  Now what I am trying to do is to reduce all the variables dimensions w.r.t Height.</p>
  
  <p>I have got my matrix, now wanted to remove all rows containing Nan Value</p>
  
  <blockquote>
    <p>NaN   736536.710457717    28.3771283105297    69.6958150783291
    NaN   736536.710457858    28.3778490697636    69.6956231314990<br>
    75    736536.710458284    28.3800119048871    69.6950471308031
    75    736536.710458426    28.3807327583405    69.6948551510433
    NaN   736536.710458000    28.3785699096006    69.6954311612445
    NaN   736536.710458142    28.3792909110158    69.6952391459993</p>
  </blockquote>