How to open a file of unknown type?

조회 수: 16 (최근 30일)
Goncalo Costa
Goncalo Costa 2021년 10월 9일
댓글: Star Strider 2021년 10월 9일
I am trying to open a file "pulse" of type "file", on my MATLAB, with the purpose of plotting a 2D graph. The type of the file is unknown to me, but when I write:
type pulse
I get a set of random characters as a result. How can I find the type of file, and plot it, as I know this to be a file with data for a 2D plot.

답변 (1개)

Star Strider
Star Strider 2021년 10월 9일
The ‘random characters’ likely mean that it is a binary file. If so, use fread to read it, although unless more is known about the file format, reading it may be a process of trial-and-error until it is imported correctly.
It could also be Unicode, and that would also require some experimentation, possibly with the unicode2native function.
.
  댓글 수: 2
Goncalo Costa
Goncalo Costa 2021년 10월 9일
When I do as you wrote I get:
"Invalid text character. Check for unsupported symbol, invisible character, or pasting of non-ASCII characters."
I believe this file was a ".m" file but was encripted or modified to be emailed to me. I just want to plot the data in its original form, but somehow the file is not presented as data, but as random symbols.
Thank you so much for your help.
Star Strider
Star Strider 2021년 10월 9일
That’s important information. If it is (or originally was) an .m file, it’s likely in pcode.
See How to decrypt a pcode to understand that it will likely not be possible to convert it back to something readable. If the documentation for it is available, run it using that information.
Good luck with it!
.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by