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

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 日

0 投票

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));

1 件のコメント

Andrea
Andrea 2012 年 11 月 21 日
Thanks! That works perfectly!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCell Arrays についてさらに検索

質問済み:

2012 年 11 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by