フィルターのクリア

Loading mat files in matlab created from octave

124 ビュー (過去 30 日間)
Adib Zaman
Adib Zaman 2014 年 7 月 3 日
コメント済み: Gordon Fox 2023 年 1 月 6 日
I have this .mat file created from octave, which contains structures. When I wanted to load the mat files from matlab, it shows an error. How to load these files?
>> y = load('murikhao.mat')
Error using load
Unable to read MAT-file murikhao.mat: not a binary MAT-file.
Try LOAD -ASCII to read as text.
adding '-ascii' parameter didnt help.

採用された回答

Robert
Robert 2014 年 11 月 30 日
Really late reply, but I came across this issue today and wanted to post the solution. Try using the option -mat7-binary in your octave save command.
save -mat7-binary 'filename' 'var1' 'var2'
I'm using R2014a on my osx host and octave 3.8.1 on a linux vm.
  4 件のコメント
Juan Martin Farias
Juan Martin Farias 2023 年 1 月 5 日
This worked perfectly for me too. I am using R2021b in Windows 10
Thanks!
Gordon Fox
Gordon Fox 2023 年 1 月 6 日
Fixed the problem for me too! I'm using R2020a.

サインインしてコメントする。

その他の回答 (2 件)

James Tursa
James Tursa 2014 年 7 月 3 日
If MATLAB can't load it, then I would guess that it was not written properly in Octave. Double check the way Octave is writing this file.
  13 件のコメント
Walter Roberson
Walter Roberson 2018 年 10 月 20 日
移動済み: Rik 2023 年 1 月 5 日
Load the file in octave, save it in MATLAB binary format.
Walter Roberson
Walter Roberson 2018 年 10 月 20 日
移動済み: Rik 2023 年 1 月 5 日
Octave
Built-in Variable: default_save_format
This variable specifies the default format for the save command. It should have one of the following values: "ascii", "binary", float-binary, or "mat-binary". The initial default save format is Octave's text format.

サインインしてコメントする。


kkyaj
kkyaj 2018 年 10 月 20 日
編集済み: kkyaj 2018 年 10 月 20 日
The default_save_format in octave is a nice feature which I did know existed. Thanks, Walter. That is helpful.
I believe that we agree the solution to "how can i load octave *.mat files not written in mat-binary format into matlab?" is that matlab will not do this natively.
One needs to externally load/resave using octave (with '-mat7-binary' flag) or scipy (with io.loadmat, io.savemat), which is to say that there is no matlab solution to this.
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 10 月 22 日
It is possible that someone has written code to import octave save format into MATLAB, but that functionality is not built into MATLAB.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeOctave についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by