Extracting data from a matrix to a vector side by side

Hi folks,
I'm developing a GUI on appdesigner. From a DropDown list, the user will choose an option, then the "description" of this option need to be exported to specific cell on Excel. The problem is that I'm not being sucessfull in this operation because the DropDown list creates a Matrix with it's description, when I exporte the vector the Excel file seems to do not understand and print only the first letter.
escolha_marca_concorrente=app.ConcorrenteDropDown.Value;
if strcmp(escolha_marca_concorrente,'Atlas Copco')
equipamento_concorrente=sprintf(app.AtlasCopcoDropDown.Value)
elseif strcmp(escolha_marca_concorrente,'Ingersoll Rand')
equipamento_concorrente=str2double(app.IngersollRandDropDown.Value);
elseif strcmp(escolha_marca_concorrente,'Chicago')
equipamento_concorrente=str2double(app.ChicagoDropDown.Value);
end
nome_cliente=app.cliente.Value;
nome_contato=app.contato.Value;
nome_email=app.email.Value;
hora_total_dia=horas_fora_ponta+horas_ponta;
horas_fora_ponta_anual=((horas_fora_ponta*dias_semana)+horas_sabado+horas_domingo)*52.1429;
horas_ponta_anual=horas_ponta*dias_semana*52.1429;
xlswrite('relatorio.xlsx',nome_cliente,'Descritivo','G7');
xlswrite('relatorio.xlsx',nome_contato,'Descritivo','G8');
xlswrite('relatorio.xlsx',nome_email,'Descritivo','G9');
xlswrite('relatorio.xlsx',consumo_pcm,'Descritivo','T13');
xlswrite('relatorio.xlsx',hora_total_dia,'Descritivo','K16');
xlswrite('relatorio.xlsx',dias_semana,'Descritivo','K17');
xlswrite('relatorio.xlsx',horas_fora_ponta_anual,'Descritivo','K18');
xlswrite('relatorio.xlsx',horas_ponta_anual,'Descritivo','K19');
xlswrite('relatorio.xlsx', equipamento_concorrente,'Descritivo','R22');
winopen('relatorio.xlsx');

2 Comments

xlswrite('relatorio.xlsx', {nome_cliente}, 'Descritivo','G7');
and similar.
It works!!! Thank you very much.

Answers (0)

This question is closed.

Asked:

on 15 May 2020

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!