Error when opening merged SPM.mat file

1 回表示 (過去 30 日間)
Muhammad Badarnee
Muhammad Badarnee 2022 年 12 月 12 日
コメント済み: Muhammad Badarnee 2022 年 12 月 12 日
Hi everyone,
I merged 15 SPM.mat files (each is after 1st level analysis & estimation) into one file called SPM.mat. I tried to see the results on SPM12, but I got an error says that the file is not estimated! (I tried to estimate it but then I got another error says that SPM is not able to estimate the merged file!)
I'd really appriciate your help if any one has an idea about how to open the merged SPM.mat file using SPM-12 or how to deal with the error says "the file is not estimated" although the original subfiles that I merged, were estimated.
Thank you so much!
Muhammad Badarnee.
  2 件のコメント
Walter Roberson
Walter Roberson 2022 年 12 月 12 日
How did you do the merging?
Muhammad Badarnee
Muhammad Badarnee 2022 年 12 月 12 日
This is how I merged the files, let's say for two files, for example:
var1= load ('SPM1.mat')
var2= load ('SPM2.mat')
save spm.mat var1 var 2
pls let me know what do you think.
Thanks,
MB.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2022 年 12 月 12 日
var1= load ('SPM1.mat')
var2= load ('SPM2.mat')
save spm.mat var1 var2
when you load() and assign the output to a variable, the output becomes a struct with one field for each input variable in the .mat file.
You are then storing those structure into spm.mat without extracting the content.
var1= load ('SPM1.mat');
var2= load ('SPM2.mat');
save('spm.mat', '-struct', 'var1');
save('spm.mat', '-struct', 'var2', '-append')
  1 件のコメント
Muhammad Badarnee
Muhammad Badarnee 2022 年 12 月 12 日
Thank you so much, Walter.

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

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by