why xlswrite writes each letter of the string into each cell of excel?

조회 수: 3 (최근 30일)
I used xlswrite to write a string which is the mixture of letters and numbers into the excell cell. I want each string to be written in 1 cell but it wirtes each letters of the string to each cell.
I tried using cell arrays but it did not work.
Any suggestion?

채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 21일
You are probably passing a character vector, which is technically an array.
Passing a cell array of character vectors will work with Windows with Excel installed. For other operating systems or if Excel cannot be reached then xlswrite requests get converted into dlmwrite requests of csv (text), and that cannot handle cell arrays.
The solution is to use writetable from r2013b, or writecell or writematrix from r2019b
  댓글 수: 2
Zeynab Mousavikhamene
Zeynab Mousavikhamene 2020년 2월 21일
I am working with 2018b. I can promote to later one but afraid some functions are changed and I get error.
Walter Roberson
Walter Roberson 2020년 2월 21일
writetable then, possibly after cell2table() or array2table()

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

추가 답변 (0개)

카테고리

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