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: Specifical way of writting in an .xls file
Replies: 2   Last Post: Jul 29, 2013 9:59 AM

Advanced Search

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

Posts: 31
Registered: 5/29/13
Specifical way of writting in an .xls file
Posted: Jul 29, 2013 5:50 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,

I encounter difficulties to write something in an .xls file. It is somehow complex ; to sum up, I firstly write on line A1 6 different strings, then I use a while loop in order to call a function named simulation4 50 times with random parameters. This function returns several parameters BUT it can happen than the first two parameters nbr_de_reflux and nbr_de_reflux_trouver are empty. If they are not empty I need to write directly after line A1 the different parameters in order.

I know how to do this if I specify a line (A2,A3...) or a position but I ignore how to do this if I don't specify a position at all. I need to write everything one after the other when nbr_de_reflux and nbr_de_reflux_trouver are not empty. Else, I jump to next inex in the while loop. So here is my function :

function simulation_de_simulation

warning('off','MATLAB:xlswrite:AddSheet')
ii=1;

T1='ampli_bruit';
T2='ampli_reflux';
T3='ampli_air';
T4='nbr_pic';
T5='nbr_reflux';
T6='nbr_reflux_trouver';

Tableau_cellule1 = cell(1,6);
Tableau_cellule1{1,1} = T1;
Tableau_cellule1{1,2} = T2;
Tableau_cellule1{1,3} = T3;
Tableau_cellule1{1,4} = T4;
Tableau_cellule1{1,5} = T5;
Tableau_cellule1{1,6} = T6;

xlswrite('simulation_de_simulation',Tableau_cellule1,'result','A1');

while(ii<=50)

[nbr_de_reflux nbr_de_reflux_trouver ampli_bruit ampli_reflux ampli_air nbr_pic]=simulation4(round(10+40*rand()),round(100+600*rand()),round(3000+4000*rand()),round(1+16*rand()));

if(~isempty(nbr_de_reflux)& ~isempty(nbr_de_reflux_trouver));

%HERE : I DONT KNOW HOW TO USE XLSWRITE IN ORDER TO WRITE WHAT I WANT.


end


ii=ii+1;

end
end



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.