writing string into excel

조회 수: 9 (최근 30일)
Af
Af 2020년 5월 8일
댓글: Af 2020년 5월 12일
I am trying to simply write cell string array to excel
xlswrite(ExclFl,cellstr("1.1234"),'A1:A1');
or
xlswrite(ExclFl,{'1.1234'},'A1:A1');
in excel the written string is shown as 11.234, I tried to change the format of the cell but no luck.
Another strange observation is that if I have a string like
xlswrite(ExclFl,{'0.1234'},'A1:A1');
then it is correctly shown in excel.
Any idea?
  댓글 수: 4
dpb
dpb 2020년 5월 8일
Same ML Release, Excel version, still Win7 though.
While didn't test on W10, I've never observed such on that system either, so agree must be something unique to your setup.
What happens if you use writetable instead of xlswrite?
Af
Af 2020년 5월 12일
Writetable does the trick. I do not have problems with that.

댓글을 달려면 로그인하십시오.

답변 (1개)

Harsha Priya Daggubati
Harsha Priya Daggubati 2020년 5월 11일
Hi,
I could not reproduce the same at my end too. I guess there might be a cache issue. Try using the following commands.
rehash toolbox
rehash toolboxcache
Hope this helps!
  댓글 수: 4
dpb
dpb 2020년 5월 11일
Same Q? as above...what if you use writetable instead? Would prove whether it is MATLAB/xlswrite that is the problem or a system/Excel issue. The above looks like locale settings issues may be in the way.
Af
Af 2020년 5월 12일
Writetable does the trick. I do not have problems with that.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by