writecell() error with 'AutoFitWidth' option

10 visualizaciones (últimos 30 días)
Changho Yun
Changho Yun el 13 de Dic. de 2021
Comentada: Changho Yun el 22 de Dic. de 2021
If i put the following single line in MATLAB_R2021b, I have an error massage that 'AutoFitWidth' is not valid parameter name.
writecell({1,2},"temp.txt","AutoFitWidth",true);
Other options are working well, but only 'AutoFitWidth' does not work.
The exact error massage is the following (Its in Korean)
다음 사용 중 오류가 발생함: writecell (195번 라인)
유효하지 않은 파라미터 이름임: AutoFitWidth.

Respuestas (1)

Gargi Patil
Gargi Patil el 21 de Dic. de 2021
Hi,
The property AutoFitWidth is used to adjust column width automatically. Thus, it can only be used when writing to spreadsheet file formats of the type .xls, .xlsx etc. and not while writing to text files.
The following code snippet can be used instead:
writecell({1,2},'temp.xlsx','AutoFitWidth', true);
  1 comentario
Changho Yun
Changho Yun el 22 de Dic. de 2021
Thank you.
I thought it makes empty spaces to align the columns

Iniciar sesión para comentar.

Categorías

Más información sobre 대화 상자 en Help Center y File Exchange.

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!