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ÊûÖÏØ<UkyAÕÜ×±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«çŋĘîNgÌá(Ð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 个评论
Steven Fried
2022-3-7
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!
Paul Hardy
2022-3-7
回答(2 个)
"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 个评论
Paul Hardy
2020-10-20
Paul Hardy
2020-10-22
Stephen23
2020-10-22
"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
Paul Hardy
2020-10-22
Paul Hardy
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.
Paul Hardy
2020-10-22
Walter Roberson
2020-10-22
No! You cannot get useful data from a mat file using fread. You need to load() it or use matFile()
"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.
Paul Hardy
2020-10-23
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!