Accessing columns of the excel
1 view (last 30 days)
Show older comments
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 Comments
Answers (0)
See Also
Categories
Find more on Data Import from MATLAB 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!