Accessing columns of the excel
1 次查看(过去 30 天)
显示 更早的评论
Hi all,
I have the following code,
fileName = 'D:\CVT\VBA\Practice_tradespace.xlsm'
fileName_template = 'D:\CVT\VBA\Practice_tradespace_template.xlsm'
copyfile(fileName_template, fileName)
%Requirements_idx = size(pareto_frontier_archs, 2)
Requirements_idx = 1:size(pareto_frontier_archs, 2)
writematrix(Requirements_idx', fileName, 'Sheet', 1, 'Range', 'A3')
Alphabet = 'ABDFHJLNPRTVXZ'
for row_=1:size(pareto_frontier_archs, 1)
xcel_col = num2str(row_+2)
excel_col = strcat(Alphabet(1+row_), '3')
writematrix(pareto_frontier_archs(row_,:)', fileName, 'Sheet', 1, 'Range', excel_col)
end
It is showing the result of the pareto_frontier_archs in every alternate columns in excel.
Now the thing is, when the number of pareto_frontier_archs increases and which will increase for sure, this code with Alphabet = 'ABDFHJLNPRTVXZ', is not working. As this Alphabet variable is only have values until 'Z', the number of archs beyond that is not working.
I want to make this dynamic to the change and increament to the number of archs and write them in alternate columns till the last number of archs.
Your inputs would be of a great help.
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!