X-Received: by 10.224.172.129 with SMTP id l1mr6846110qaz.4.1373277212512;
        Mon, 08 Jul 2013 02:53:32 -0700 (PDT)
X-Received: by 10.50.22.9 with SMTP id z9mr1061891ige.6.1373277212460; Mon, 08
 Jul 2013 02:53:32 -0700 (PDT)
Path: news.mathworks.com!newsfeed-00.mathworks.com!news.kjsl.com!feeder.erje.net!us.feeder.erje.net!news.glorb.com!t19no729294qam.0!news-out.google.com!f7ni1559qai.0!nntp.google.com!t19no763167qam.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: comp.soft-sys.matlab
Date: Mon, 8 Jul 2013 02:53:32 -0700 (PDT)
In-Reply-To: <krdsv9$m8a$1@newscl01ah.mathworks.com>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=202.78.152.105;
 posting-account=qPexFwkAAABOl8VUndE6Jm-9Z5z_fSpR
NNTP-Posting-Host: 202.78.152.105
References: <krdsv9$m8a$1@newscl01ah.mathworks.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <ba525a55-8961-41c8-8d54-c6728a96f164@googlegroups.com>
Subject: Re: xls  file  in matlab
From: TideMan <mulgor@gmail.com>
Injection-Date: Mon, 08 Jul 2013 09:53:32 +0000
Content-Type: text/plain; charset=ISO-8859-1
Lines: 68
Xref: news.mathworks.com comp.soft-sys.matlab:798962

On Monday, July 8, 2013 8:24:09 PM UTC+12, george veropoulos wrote:
> Dear  friend  
> 
> 
> 
> i  run the  following  code  in  matlab
> 
> 
> 
> 
> 
> spin=1/2;
> 
> r_parallel=10;
> 
> theta=0;
> 
> n=1;
> 
> l=0;
> 
> yi=1;
> 
> B=ones(size(10000));
> 
> Enl=ones(size(10000));
> 
> wave_function=ones(size(10000));
> 
> for  i=0:5 
> 
> B=i;
> 
> [wave_function,Enl]=psi_parallel(r_parallel,theta,n,l,spin,yi,B);
> 
> 
> 
> xlswrite('results.xlsx', B,'sheet1','A')
> 
> xlswrite('results.xlsx',Enl,'sheet1','B')
> 
> end
> 
> 
> 
> 
> 
> the  problem is that  in xls(RESULTS)  file  i have  ONLY  one  value 
> 
> for  B=5  NOT  ALL THE  VALUES  .(i=0,1,3,5  )
> 
> 
> 
> please  help me
> 
> thank you in advance

Yes, because you're printing it in A1 each time through the loop.
But, first, what do you expect to get from this statement:
B=ones(size(10000)); 
?
Try this:
size(ones(size(10000)))
Is that what you expected?
why not:
B=ones(1000,1);
Then put your calculations inside the loop and write to Excel outside the loop.