gpt4 book ai didi

excel - matlab在GUI中生成excel文件

转载 作者:行者123 更新时间:2023-12-04 22:09:45 25 4
gpt4 key购买 nike

我有 example.xlsx包含一些数据的文件。

我想在 GUI 中显示数据,并且希望有一个选项可以在 GUI 中编辑 xlsx 文件。

有没有办法做到这一点?有人知道吗?

我试图通过 ActiveX 控件找到 xls,但我没有看到该选项:/

我有 matlab 2010a,当我按下“ActiveX 控件”时,这些是我的选项:

enter image description here

谢谢你 :]

最佳答案

不需要activeX,matlab自带函数, xlswrite xlsread :

帮助文件:

xlswrite(filename,A) writes array A to the first worksheet in Excel file filename, starting at cell A1.

xlswrite(filename,A,sheet) writes to the specified worksheet.

xlswrite(filename,A,range) writes to the rectangular region specified by range in the first worksheet of the file. Specify range using the syntax 'C1:C2', where C1 and C2 are two opposing corners that define the region.

xlswrite(filename,A,sheet,range) writes to the specified sheet and range.

status = xlswrite(filename,A,sheet,range) returns the completion status of the write operation: true (logical 1) for success, false (logical 0) for failure. Inputs sheet and range are optional.

[status,msg] = xlswrite(filename,A,sheet,range) returns any warning or error message generated by the write operation in structure message. Inputs sheet and range are optional.



和:

[num,txt,raw] = xlsread(filename) reads data from the first worksheet in the Microsoft Excel spreadsheet file named filename and returns the numeric data in array num. Optionally, returns the text fields in cell array txt, and the unprocessed data (numbers and text) in cell array raw. If your system does not have Excel for Windows, xlsread operates in basic import mode, and reads only XLS or XLSX files.

[num,txt,raw] = xlsread(filename,sheet) reads the specified worksheet.

[num,txt,raw] = xlsread(filename,range) reads data from the specified range of the first worksheet in the file. Specify range using the syntax 'C1:C2', where C1 and C2 are two opposing corners that define the region.

[num,txt,raw] = xlsread(filename,sheet,range) reads from the specified sheet and range.

[num,txt,raw] = xlsread(filename,-1) opens an Excel window to interactively select data. Supported only on Windows systems with Excel software.

[num,txt,raw] = xlsread(filename,sheet,range,'basic') reads data from the spreadsheet in basic mode, the default on systems without Excel for Windows.

[num,txt,raw,custom] = xlsread(filename,sheet,range,'',functionHandle) reads from the spreadsheet, executes the function associated with functionHandle on the data, and returns the final results. Optionally, returns additional custom output, which is the second output from the function. xlsread does not change the data stored in the spreadsheet. Supported only on Windows systems with Excel software.



http://www.mathworks.com/help/techdoc/ref/xlswrite.html

通过您选择的用户交互和显示样式(不确定是否需要绘图或表格、按钮或 slider ),这允许您与 xls 文档进行交互。

关于excel - matlab在GUI中生成excel文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10818912/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com