Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Extracting data from a matrix to a vector side by side

1 回表示 (過去 30 日間)
Jucimar Carpe
Jucimar Carpe 2020 年 5 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 16 日
xlswrite('relatorio.xlsx', {nome_cliente}, 'Descritivo','G7');
and similar.
Jucimar Carpe
Jucimar Carpe 2020 年 5 月 16 日
It works!!! Thank you very much.

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by