Issue with reading text value from a cell in MS Excel using readmatrix

36 ビュー (過去 30 日間)
I am trying to read a text data in a cell in Excel to a variable in Matlab using the "readmatrix" command. I am using the following syntax.
But it is reading NaN value instead of the actual text. If I change the cell location (range) to another cell containing numeric data it is reading correctly. But only in case of text data this is happening. Kindly help me in resolving this issue. Thank you.


Jonas 2022 年 8 月 8 日
if i am not mistaken, readmatrix expects numbers for each entry, so the numbers can be but into a matrix. if your data contains numbers and text (multiple characters per cell), try readcell instead
  1 件のコメント
Subraya Krishna Bhat
Subraya Krishna Bhat 2022 年 8 月 9 日
Thank you very much for your answer! Now I am able to read the text value from Excel. I used readcell as follows with similar syntax as readmatrix:


その他の回答 (0 件)


Help Center および File ExchangeSpreadsheets についてさらに検索




Community Treasure Hunt

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

Start Hunting!

Translated by