Trouble reading data from .mat file

I'm trying to read data in .mat file but data is displaying in corrupted format. Version I'm using is 2015rb.

4 件のコメント

Geoff Hayes
Geoff Hayes 2019 年 11 月 28 日
Zarish - please clarify what you mean by data is displaying in corrupted format. Is the 1.mat file the result of running your attached function? Is there supposed to be feaSet data in it?
[~, fname] = fileparts(frames(jj).name);
fpath = fullfile(rt_data_dir, subname, [fname, '.mat']);
save(fpath, 'feaSet');
How are you trying to read the data?
Image Analyst
Image Analyst 2019 年 11 月 28 日
storedStructure = load('1.mat')
Error using load
Unable to read MAT-file C:\Users\Mark\Documents\MATLAB\work\Tests\1.mat. Not a binary MAT-file. Try load -ASCII to read as text.
Error in test5 (line 1)
storedStructure = load('1.mat')
storedStructure = load('1.mat', '-ASCII')
Error using load
Unknown text on line number 1 of ASCII file 1.mat
"MATLAB".
Error in test5 (line 1)
storedStructure = load('1.mat', '-ASCII')
Looks like it's really corrrupted. Where did you get it or how was it created?
Zarish Anwar
Zarish Anwar 2019 年 11 月 28 日
@Geoff Hayes
i'm computing sift descriptor values over my dataset. The code works fine and .mat file is being created for each image but values are not showing I'm getting this file as output
Geoff Hayes
Geoff Hayes 2019 年 11 月 29 日
But what do you mean by values are not showing. Is the 1.mat file invalid?

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

回答 (1 件)

Luna
Luna 2019 年 11 月 28 日

0 投票

Hi,
Try this:
fid = fopen('1.mat');
values = fread(fid);
fclose(fid);
It seems only file created
'MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Thu Jan 01 02:47:51 2015'
The rest of data can not be seen.

2 件のコメント

Zarish Anwar
Zarish Anwar 2019 年 11 月 28 日
@Luna
I'm able to read the data, my 1st coloumn is providing me values. But I have a large dataset and for each img a seperate mat file have to be created. And have to be save in a directory,
But problem is whenever I save file it is not showing data/values.
Luna
Luna 2019 年 11 月 29 日
can you share the code shows how it is saved? We should know the saving method I guess.

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

カテゴリ

ヘルプ センター および File ExchangeWorkspace Variables and MAT Files についてさらに検索

タグ

質問済み:

2019 年 11 月 28 日

コメント済み:

2019 年 11 月 29 日

Community Treasure Hunt

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

Start Hunting!

Translated by