matlab 文件列表,如何從Matlab寫入多個列表到同一個excel文件?

这篇博客介绍了如何在Matlab中将两个不同长度的列表xordered和aspl写入同一Excel文件的同一工作表中。通过创建一个组合矩阵并使用xlswrite函数,可以在A列和B列分别保存这两个列表的数据。具体方法是将两个列表按行连接起来,然后使用xlswrite将结果写入文件'edgar.xls'的A2到B300范围内。
摘要由CSDN通过智能技术生成

I have several lists in Matlab that I want to write to the same excel file. I have one list xordered and another list aspl. I do not know the length of the lists till after I run the Matlab program.

我在Matlab中有幾個列表要寫入同一個excel文件。我有一個xordered列表和另一個列表aspl。在運行Matlab程序之前,我不知道列表的長度。

I used

我用了

data = xlswrite('edgar.xls',fliplr(sortedx'),'A2:A3000')

for the first list but when I tried to write another list to the same file like this I ended up with two different excel files named edgar.xls

對於第一個列表但是當我嘗試將另一個列表寫入同一個文件時,我最終得到了兩個名為edgar.xls的不同excel文件

asp_data = xlswrite('edagr.xls', fliplr(aspl'), 'B2:B3000')

Is there a way I can write both of these lists into the same excel file? xordered in the A column and aspl in the B column?

有沒有辦法可以將這兩個列表寫入同一個excel文件中?在A列中排序並在B列中輸入aspl?

1 个解决方案

#1

2

d = [ fliplr(sortedaspl'), fliplr(sortedx')];

d = [fliplr(sortedaspl'),fliplr(sortedx')];

Makes a matrix from A2 to B300

制作從A2到B300的矩陣

data = xlswrite('edgar.xls',d,'A2:B300');

data = xlswrite('edgar.xls',d,'A2:B300');

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值