如何使xlswrite的写入位置变量xlRange,列号(A,B,C...)递增。
1 view (last 30 days)
Show older comments
已知函数xlswrite(filename,A,sheet,xlRange),
要使xlrange写入位置纵向移动,只要写个从A1到An的循环就可以了。
但是要让xlrange写入位置水平移动,如何写变量让其从A1到???1循环?
要是遇到写入位置需要移动很多位的,使用ASCII转成数字,之后+1,再转成字符的方法就太麻烦了。
0 Comments
Accepted Answer
jmxmeag
on 25 May 2023
先定义一个全列号变量,然后根据输入n查询第n列的列号就可以了。
col_str = ['A':'Z']; %假设到Z
n = 6;
xlswrite(filename, A, sheet, ['A1:','col_str(n),'1']);
0 Comments
More Answers (0)
See Also
Categories
Find more on Convert Image Type in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!