Python Forum
Reading of structured .mat (matlab) file
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Reading of structured .mat (matlab) file
#1
Hi
I am trying to Read .mat (matlab) structured file using python.[/b]
1: I had opened the file using scipy.io
2:Tried to print the data but,all data is printing in combined structure not in original hierarchical format


How can I able to read the data from mat file in its original structured way.
Reply
#2
post your code in python tags, along with sample input/desired output data
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
code:
import scipy.io as spio
mat = spio.loadmat('F:\\matlab_file.mat', squeeze_me=True)
print(type(mat))
key=(mat.keys())
value1=mat[key[0]]


Here is the code
Output of value1 should be in dictionary format as it is nested structure
But I am getting list or nd.array that is combined data
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Exclamation URGENT: How to plot data from text file. Trying to recreate plots from MATLAB JamieAl 4 3,549 Dec-03-2023, 06:56 AM
Last Post: Pedroski55
  Excel File reading vanjoe198 1 2,038 Mar-31-2021, 11:53 AM
Last Post: snippsat
  reading from a file looseCannon101 14 4,907 Jul-18-2020, 11:29 AM
Last Post: GOTO10
  Weird problem with reading from file and performing calculations pineapple999 1 2,999 Jul-25-2019, 01:30 AM
Last Post: ichabod801
  Handling IO Error / Reading from file Expel 10 4,833 Jul-18-2019, 01:21 PM
Last Post: snippsat
  Reading an Unconventional CSV file OzSbk 2 3,875 May-17-2019, 12:15 PM
Last Post: MvGulik
  reading text file and writing to an output file precedded by line numbers kannan 7 10,393 Dec-11-2018, 02:19 PM
Last Post: ichabod801
  File Reading toxicxarrow 9 5,172 May-07-2018, 04:12 PM
Last Post: toxicxarrow
  reading all lines from a text file seadoofanatic 2 2,924 Mar-13-2018, 06:05 PM
Last Post: Narsimhachary
  Reading a text file fivestar 7 5,580 Oct-13-2017, 07:25 AM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020