Borrar filtros
Borrar filtros

Accessing columns of the excel

1 visualización (últimos 30 días)
kaivlya patel
kaivlya patel el 29 de Abr. de 2020
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.

Respuestas (0)

Categorías

Más información sobre Data Import from MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by