# How to import a matrix of integers from MATLAB?

I am importing a matrix from MATLAB. However, there are some redundant items added in the imported matrix.

For example, the imported matrix is a binary matrix. After import, it looks like this

{{{{{0, 1, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 1., 0., 0., 0., 0., 1., 1., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0.}, {1., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 1., 1., 0., 0., 0., 0.,
1., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
0., 0., 0., 0.},......}}}}};


How can I get rid of . and ?

There are some additional brackets also. However, the brackets are not an important issue.

The dimension is found to be {1, X, Y}. Where does this 1 come from?

• What command do you use for importing? the leading 1 in the dimensions is probably from there. Please give the details. May 20 '19 at 12:58
• I am using Import? May 20 '19 at 13:00
• By "details" I mean write down the command with all options. Otherwise the reader needs to guess that you've used Import with no further options. The easier you make it for the reader, the better your chances of getting help. May 20 '19 at 13:02
• Import["C:\Users\dipak\Desktop\data.mat"] May 20 '19 at 13:03
• Matlab does not know integers. First axiom of Matlab: Everything is a matrix of doubles (machine precision real numbers). May 20 '19 at 14:11

Round[data]

Or Round[First[data]]` to get rid of the first dimension of length 1.