Octave:不支持Excel

时间:2012-08-03 13:20:57

标签: excel matlab octave xls

我最近下载了Octave,因为我需要将.mat文件转换为.xls。

我将.mat文件导入程序然后运行此代码:
xlswrite('Elettra.xls', 'elettra_processed_data.mat')

但是我收到了这个错误:

Creating file Elettra.xls
Supported interfaces: 
warning: No support for Excel .xls I/O
error: oct2xls: unknown Excel .xls interface - NONE.
error: called from:
error:   C:\Octave\3.2.4_gcc-4.4.0\share\octave\packages\io-1.0.11\oct2xls.m at line 100, column 3
error:   C:\Octave\3.2.4_gcc-4.4.0\share\octave\packages\io-1.0.11\xlswrite.m at line 160, column 6
>> Variables in the current scope:

 Name                 Size             Class           Bytes       
 ====                 ====             =====           =====        
 ans                  1x11             cell            92          
 dirlist              1x6              cell            18          
 ii                   1x1              double          8           
 old_format           1x45             char            45          
 processedData        1x1              struct          3978113     

Total is 64 elements using 3978276 bytes

有没有人有任何想法?我对这个程序不太熟悉。

2 个答案:

答案 0 :(得分:0)

你的头衔说明了。由于xlswrite函数使用Windows COM,因此Octave没有内置支持从Excel读取/写入。话虽如此,有options that include using pure java,在博客Undocumented Matlab上进行了讨论。

你是什么意思“将.mat文件转换为.xls”你的意思是你想要读取mat文件中的数据并将其写在Excel中吗?如果是这样的话,如果你没有合适的Matlab,你需要卷起袖子。

答案 1 :(得分:0)

您可以先使用

加载数据
load elettra_processed_data.mat

然后在当前范围内应该有你的struct“processedData 1x1 struct 3978113”。由于我不知道结构中的内容,只需调用名称

即可找到
processedData

将有一个输出,为您提供结构的子元素的名称(可能包含大量数据):

processedData =
{
   lat = ...
   lon = ... 
   positions = ...
}

如果您找到要保存的数据(让我们说它在位置上),您可以致电

csvwrite("Elettra.csv", processedData.positions);

和Elettra.csv可以用Excel打开。