how can I save mat files into mat file?

5 ビュー (過去 30 日間)
Giorgi
Giorgi 2014 年 12 月 15 日
コメント済み: Giorgi 2014 年 12 月 15 日
Hi guys! Well imagine that I have two mat files one is a.mat and the second is b.mat file. Now i want to save them into another ab.mat file for example in such a way
save (ab.mat, 'a.mat', 'b.mat')
But it says that a.mat and b.mat are not valid variables so any ideas would be a great job for me ;)

採用された回答

Adam
Adam 2014 年 12 月 15 日
aLoad = load( 'a.mat' );
bLoad = load( 'b.mat' );
save( 'ab.mat', '-struct', 'aLoad' );
save( 'ab.mat', '-struct', 'bLoad', '-append' );
works. It's probably neater to merge the structs and do a single save, but I couldn't remember off the top of my head how to do that so if this is a one-time operation then that solution works fine.
  1 件のコメント
Giorgi
Giorgi 2014 年 12 月 15 日
Thx a lot

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by