title: Matlab: Saving workspace variables as a .txt file
body: <p>On the workspace the following <code>cfit</code> variables are obtained. I could not extract any data from such variables and was wondering if there is a code I am missing that could do this for me.</p>
  
  <pre><code>A = 
  
       General model:
       fitresult(x) = y0+a*exp(-.5*((x-xa)/wa)^2)+b*exp(-.5*((x-xb)/wb)^2)+c*exp(-
                      .5*((x-xc)/wc)^2)+d*exp(-.5*((x-xd)/wd)^2)
       Coefficients (with 95% confidence bounds):
         a =        1693  (1089, 2297)
         b =        8768  (8145, 9392)
         c =        4480  (1942, 7017)
         d =        3841  (2625, 5057)
         wa =       39.36  (31.01, 47.7)
         wb =       16.67  (15.92, 17.41)
         wc =       13.05  (10.58, 15.51)
         wd =       21.34  (15.41, 27.28)
         xa =       99.23  (96.06, 102.4)
         xb =       103.5  (103.1, 103.9)
         xc =       273.5  (271.9, 275.2)
         xd =       298.2  (285.9, 310.5)
         y0 =        4158  (4049, 4266)
  
   B =
  
  
  
       General model:
       fitresult(x) = y0+a*exp(-.5*((x-xa)/wa)^2)+b*exp(-.5*((x-xb)/wb)^2)+c*exp(-
                      .5*((x-xc)/wc)^2)+d*exp(-.5*((x-xd)/wd)^2)
       Coefficients (with 95% confidence bounds):
         a =        1693  (1089, 2297)
         b =        8768  (8145, 9392)
         c =        4480  (1942, 7017)
         d =        3841  (2625, 5057)
         wa =       39.36  (31.01, 47.7)
         wb =       16.67  (15.92, 17.41)
         wc =       13.05  (10.58, 15.51)
         wd =       21.34  (15.41, 27.28)
         xa =       99.23  (96.06, 102.4)
         xb =       103.5  (103.1, 103.9)
         xc =       273.5  (271.9, 275.2)
         xd =       298.2  (285.9, 310.5)
         y0 =        4158  (4049, 4266)
  
   C = 
  
       General model:
       fitresult(x) = y0+a*exp(-.5*((x-xa)/wa)^2)+b*exp(-.5*((x-xb)/wb)^2)+c*exp(-
                      .5*((x-xc)/wc)^2)+d*exp(-.5*((x-xd)/wd)^2)
       Coefficients (with 95% confidence bounds):
         a =        1693  (1089, 2297)
         b =        8768  (8145, 9392)
         c =        4480  (1942, 7017)
         d =        3841  (2625, 5057)
         wa =       39.36  (31.01, 47.7)
         wb =       16.67  (15.92, 17.41)
         wc =       13.05  (10.58, 15.51)
         wd =       21.34  (15.41, 27.28)
         xa =       99.23  (96.06, 102.4)
         xb =       103.5  (103.1, 103.9)
         xc =       273.5  (271.9, 275.2)
         xd =       298.2  (285.9, 310.5)
         y0 =        4158  (4049, 4266)
  </code></pre>
  
  <p>I would like to modify the above variable to produce the following table and save this table as a .txt or a .csv file:</p>
  
  <pre><code>Variables   a   b   c   d   wa   wb   wc   wd   xa   xb   xc   xd  y0
  A                                                   
  B                                                   
  C   
  </code></pre>
  
  <p>Or</p>
  
  <pre><code>Variables = [a, b, c, d, wa, wb, wc, wd, xa, xb, xc, xd, y0]
  A = [#, #, #, #, #, #, #, #, #, #, #, #, #]
  B = [#, #, #, #, #, #, #, #, #, #, #, #, #] 
  C = [#, #, #, #, #, #, #, #, #, #, #, #, #]
  </code></pre>