Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to write a cell in excel file

Subject: how to write a cell in excel file

From: Saad

Date: 11 Dec, 2012 09:08:10

Message: 1 of 1

Dear all,

could you please advise on how I could write cell information in excel file. here is some part of the code.

out_weight=num2cell(1:100)
      for i=1:100
        xlswrite('P:\....excelfile.xls',out_weight{i}, 'Sheet2','b9');

        end

out_weight{i} represents the cell. The matrices in the cell do not have the same size so unfortunately I cannot convert my cell into a matrix and write it in excel. As you can see in my code I used a loop which I am sure is not the most efficient way to do what I want to do. Any thought on this?
 My second problem is regarding the loop, every time it loops the column of the cell changes but I do not manage to change the location in excel file. What I mean is that every time it loops it should change from b9 to c9 to d9 etc unfortunately I do not manage to include that in my code. Any advice is most welcome. Thanks a lot

S

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us