Matlab命令,用于将字符串写入excel

时间:2022-06-13 20:25:20

I am trying to write a string in a cell in an excel file using Matlab by the following command:-

我试着用Matlab编写的excel文件中的一个字符串,下面的命令是:-。

xlswrite('E:\project\messidor\Testing image.xls','hello',1,'A3');

xlswrite(' E:\ messidor \ \项目测试image.xls’,‘你好’,1,' A3 ');

but the problem is each character of the word hello is written in a different cell.

但是问题是hello这个词的每个字符都写在不同的单元格中。

In this example I want the word hello to be written in cell A3 but h is written in A3, e is written into 'B3',l is in 'C3' and so on.

在这个例子中,我想让hello这个词写在cell A3中,但是h写在A3里,e写在'B3'上,l在'C3'等等。

Pls suggest correct command.

请建议正确的命令。

1 个解决方案

#1


1  

You have to pass the value 'hello' in a cell array, like this:

您必须在单元格数组中传递值“hello”,如下所示:

xlswrite('E:\project\messidor\Testing image.xls',{'hello'},1,'A3');

Take a look at the documentation for more information.

查看文档以获得更多信息。

#1


1  

You have to pass the value 'hello' in a cell array, like this:

您必须在单元格数组中传递值“hello”,如下所示:

xlswrite('E:\project\messidor\Testing image.xls',{'hello'},1,'A3');

Take a look at the documentation for more information.

查看文档以获得更多信息。