Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: xls file in matlab
Replies: 4   Last Post: Jul 15, 2013 5:07 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Derek Goring

Posts: 3,893
Registered: 12/7/04
Re: xls file in matlab
Posted: Jul 8, 2013 5:53 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.