What code is it?

Is there someone recognize the following code and how to convert it to the normal data?
===================================================
MATLAB 5.0 MAT-file, Platform: PCWIN64, Created on: Wed Oct 14 17:38:35 2020 _
IM Ù xœ-бKBQÇñojÖb ¦¯×Ú¡A„à
nWG—2x8ê  ‚ƒ-­MŽnºô'4‰[¸æ_Ðà ›¿wž.ç~îsϹ@岊çÚ’uz´R¼YÌð
¢¼Î[í Bîiq†cEÄ¥üÎZ•/Ô(Êw<˜¿Ù™oب²ã•9%Ù£gîò¨sH›”ù“½ÙãKï:Us%W¨›?ÈáËOü‘–7ÊûÖÏØ<UkyAÕÜ×±oùUÆ1ãßÜÐ}ì&y¤c,ÍC~4y2OÙþå ÝÜ(6 G xœãc``¨ b6 æ bA`d`aÈOÊ2ѾÎþÁ º,³8‘(灤žªžÊgë…`(_¼˄$ > ÆŽ ú xœ-ÒKH”QÆñÿ0ŸYd†±‹×Ô.d}S‹¦¤¢LjÓÅZË‚.ÒUpEáÒœŠr´B0)\ˆÝ Ê¢(‰ ¢‚À¨˜`ê9O3pæ=¿ùΜó¾ïwJ¶$LSœ®ñÿSTpBã|"Ĉ®#‡——ÉUZ‚%Äâb†§¬µ#ÖÙùÍby&73ì`Àî#Ç"¹š”ÝËJ;ÍCŘ÷t°PþÁ6»ˆFé
¯õkÌõdƒô‡ÝÖVƨ—Çy§U1m|bÜÎ^{ŒÙvÄWäbÍë4*9n/£‡Zù³ì^P#gÔ¾1]¬°Ø`繪¼341¥}cÎé_ÁƒÅAwUšoÑÙAͪ#8¯Á%”Ú÷y£Â^#Ê#ÃY.Ù)Øi6Ú•Z|’ŸÊ1f’GÌ—'¢ õì·¦ô]ë®ç™'—h·¹žÓöˆº]í.æ˜+ßc§ÓiÁ}éœX½þÀy©ž?§Ó>E¿²ˆy«,*äU¬±Û¹a_æ—2ˆõ¶Ú3xl_ Õîà–Ý£ú*\mÖnT‚;¹f?)ø#wì4«íW<³[ØdïỽK7 8I™óɪÁŸù&‚†è¶êô<¸_½îV/ƒ'Øîj›ùk§tû‚Ç5ՏrÌÝjâ¨ÝJ¹»»™Ûv/Ãö¾ÙÃìóÛx©Û ÿ ¯™‹ û xœ-Î1K‚QÆñ¿ùNAÔ`”ºT–Ý”JÒ›$¨!jhkª% šÃ‘‚D-B[»›PŸ ›„†š¤hqÈ¡ç=yáÞs÷árÎ(p€Õ¶ÇÿX5«çŋĘîNgÌá(Ðcš‹Ä™—ÃL‘· êÅq¬Äw›!äqöyR‰ã€K³ã„κç«ÌËR–KtX±ß?æOîY•KL2#÷¸bMî°aÎqHJÞåÄ\Q·uy–k³Ç›r™ªù‹_Òò
Oæ0¯lÉ1žÍqî4‹SÏ7sSåäG>ÌQÞÙ‘[|›‹ì“—»šÌ÷

2 个评论

Hi Paul, were you ever able to resolve this issue? It seems we have the exact same question as you, for reading the data from our SR865A lock-in amplifier. Please let us know if you were able to find a solution. Thank you!
Yes, I use SNAP? command to capture the data from the lock-in adn it works nicely.
I use SR860 but I think SR860A has similar functions.
Hope this can help to solve your problem. Good luck!

请先登录,再进行评论。

回答(2 个)

Stephen23
Stephen23 2020-10-20
编辑:Stephen23 2020-10-20
"Is there someone recognize the following code..."
It isn't code, it is a binary .mat file (just as the text at the start of the file clearly states).
"... and how to convert it to the normal data?"
The recommended way it to load into an output variable (which is a structure):
S = load('name_of_the_file.mat');
and then access the fields of that structure. Or during development (i.e. from the command line) you can also use the command-syntax:
load name_of_the_file.mat

11 个评论

Thanks Stephen for the explanation!
I got this data from the instrument that I controlled using Matlab. I will need to connect to the instrument to check it. I hope your suggestion will work fine when I have an opportunity to connect to the instrument within few days. Thanks!
Hi Stephen, Hi Walter,
I have an access to the instrument today. According to the manual of the instrument, the saved data is binary block data with little endian sequence in 32 bit (4 byte) single precision floating point. Are there any difference between binary data and binary block data?
I have used your provided command S = load('name_of_the_file.mat'). No error appear. Unfortunately, I don't get any output when I use this command.
I expect that I can convert the data to the 'normal' data.
"I have used your provided command S = load('name_of_the_file.mat'). No error appear."
Good. This means the file data was imported into the structure S.
"Unfortunately, I don't get any output when I use this command"
If there is no error then the file data has been imported into S, which is a scalar structure. As I wrote in my answer, you can access its fields, e.g.:
M = S.name_of_some_variable
Yes, I can see S (1x1 struc) in the workspace. However, it gives the same binary code in M for a certain variable when I access the variable with dot operator with S. I still didn't get the 'normal' data (maybe in ASCII).
Stephen23
Stephen23 2020-10-22
编辑:Stephen23 2020-10-22
@Paul Hardy: please upload the .mat file by clicking the paperclip button. I will take a look.
Thanks in advance!
Here is the data. Sorry to make you busy with my questions.
Stephen23
Stephen23 2020-10-22
编辑:Stephen23 2020-10-22
The object obj1 is an instance of the visa class:
To use this object you will need to have the Instrument Control Toolbox installed and a valid license for it. Probably the other strings will also make sense in the context, e.g. this page discusses .mat files:
This command might be the origin of that file (and also explains how to load the file data):
I do not have this toolbox, so I cannot check any of this.
Actually, during the connection to the instrument via Instrument Control Toolbox, after saving the data using:
save('C:\Users\data_1.mat');
Then I gave the following comments :
fileID = fopen('C:\Users\data_1.mat');
A = fread(fileID,[100 2],'uint16')
Would A give me the converted data?
Thanks in advance.
No! You cannot get useful data from a mat file using fread. You need to load() it or use matFile()
Stephen23
Stephen23 2020-10-22
编辑:Stephen23 2020-10-22
"Would A give me the converted data?"
The literal answer is "yes", it will "convert" the contents of some random binary file (interpreted as uint16) into some most likely very meaningless values. Unlikely to be very useful, but nothing is stopping you from trying.
I suspect that the real problem started with how the data was saved. I have no idea what special types/data encoding/... the Instrument Control Toolbox uses, but that would be where I would start looking.
Thanks for the comments!
@ Stephen: according to the instrument manual, the data is stored in the instrument buffer automatically when I ask the instrument to start capture the data. The data is saved as a binary block with little endian sequence of 32 bits (4bytes) single precision floating point format.
What I did more precise is, I ask the instrument to start capture the data and call the data back from the instrument buffer using the following instruction:
data_1 = query(obj1,'CAPTUREGET? 0, 32')
This instruction will retrieve the 32 kbytes data with 0 kbytes offset from the instrument buffer. However, the data_1 is binary (block?) data, as I showed you at the beginning of my question, that I need to convert to a format that we can read normally.
If you have any ideas how to solve it, please let me know.
Thanks in advance!

请先登录,再进行评论。

Walter Roberson
Walter Roberson 2020-10-20

0 个投票

That is not code. That is a .mat file created on a Windows system about a week ago.
Possibly someone accidentally did a save naming a .m file.
The code is gone, replaced with variables. There is no way to get the code back from this file.
You have to hope that there is a backup for the file. Look to see if you have any .asv (autosave) files.

2 个评论

Thanks Walter for the comments!
I got this data from the instrument that I controlled using Matlab and I need to convert this data such that I can get the data in a 'normal' way
load() the file

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Data Type Conversion 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by