Accessing data in matfile.

5 ビュー (過去 30 日間)
Amit Chakraborty
Amit Chakraborty 2021 年 7 月 6 日
回答済み: Rishik Ramena 2021 年 7 月 14 日
I have a matrix called miu. And the size of miu is ::: 262144x1 double
To save the memory purpose I have used:
miu =matfile('miu_64cube_detect256multiply256.mat');
miu.Properties.miu(ind) %% To access the data I have used the line
Error Message: Unrecognized method, property, or field 'miu' for class 'matlab.io.matfile.Properties'.
Can anyone give me some clarification and probable solution regarding this problem?
Thank You....
  4 件のコメント
Rik
Rik 2021 年 7 月 6 日
miu =matfile('miu_64cube_detect256multiply256.mat');
Nvoxels= 64*64*64;
for j = 1:Nvoxels
len = cell2mat(length_ijk(j));
ind = cell2mat(index_ijk(j));
atten(j) = exp(-sum(miu(ind).*len));
end
Unrecognized function or variable 'length_ijk'.
dpb
dpb 2021 年 7 月 6 日
Which doesn't do anything at all with the matfile object to address it and create the problem.
But, you don't address the Properties of the object, but the object itself with the variable name and index -- and, you don't have a LHS to store the result.
miu =matfile('miu_64cube_detect256multiply256.mat');
value=miu.miu(ind); % return on element of variable miu inside the matfile object

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

採用された回答

Rishik Ramena
Rishik Ramena 2021 年 7 月 14 日
Yeah, you are intending to address the object itself and not the Properties of the object.
value = miu.miu(ind);
This should be what you wanted to do. For more information on MAT files and their usage, check out this example here.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeC Data and Function Interfaces についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by