how to change value of xlswrite array using one-item vector

조회 수: 8 (최근 30일)
Andrea
Andrea 2012년 11월 20일
Hi everyone!
I was wondering if it is possible to have "flexible" array number using xlswrite in MATLAB?
This is what I have:
arrayNumber = ID+1;
xlswrite('output.xlsx', ID, 1, 'A1');
Instead of 'A1' I would like the 1 to be replaced by the vector 'arrayNumber'.
Is this possible?
Thanks! -Andrea

채택된 답변

Matt Fig
Matt Fig 2012년 11월 20일
편집: Matt Fig 2012년 11월 20일
Here is an example of how to manipulate strings in a loop...
Str = 'A';
for ii = 1:5
disp(sprintf('A%i',ii))
end
So use:
% xlswrite('output.xlsx', ID, 1, sprintf('A%i',arrayNumber));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by