'For ' loop iteration for xls read and write.

2 visualizzazioni (ultimi 30 giorni)
Hi everyone,
I am new to matlab, I am facing a problem. I have this piece of code where i am taking value from one column (128 bits, as zero and one only) of an excel file and after some steps, it gives me 11 new values of same length. right now i am manually saving these values as given below:
for i=1:11
%some steps giving me 11 new values as 128 bit strings
C(i,:)=jj(); %saving values into a matrix to write into excel.
filename = 'DATASET.xlsx';
Now in the given code i have to chnage the value of column for both read and wite file. Right now i have to manually change 'A:A: to 'B:B' for xlsread and for xlswrite i will update value of column from 'A1:K128' to 'L1:V128'. doing this for small interval is fine but i have to do it for more than 50 files using xlsread.
All i need is your help to design a loop which iterates through column by coulmn for read but for write 11 column/rows.
Thank you.

Risposta accettata

David Hill
David Hill il 25 Nov 2020
key_out=readmatrix('key.xlsx');%read all at once and then index
for j=1:12
for i=1:11
  1 Commento
Maria Imdad
Maria Imdad il 25 Nov 2020
thank you so much... it worked perfectly for me

Accedi per commentare.

Più risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by