# How to convert .mat to julia matrix

**URL:** https://discourse.julialang.org/t/how-to-convert-mat-to-julia-matrix/82283
**Category:** New to Julia
**Created:** [June 5, 2022, 8:07pm UTC](https://discourse.julialang.org/t/how-to-convert-mat-to-julia-matrix/82283 "2022-06-05T20:07:09Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![horvetz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/horvetz/32/31993_2.png) [@horvetz](https://discourse.julialang.org/u/horvetz)
#### Post date: [June 5, 2022, 8:07pm UTC](https://discourse.julialang.org/t/how-to-convert-mat-to-julia-matrix/82283/1 "2022-06-05T20:07:09Z")

</div>

I want to load a mat file from matlab and convert it to Julia matrix. Currently I can read the file but I don’t know how to extract the matrix inside the mat file

> using MAT  
> A = matread(“MyMatrix.mat”)

---

<div class="post-metadata">

### Author: ![brenhinkeller](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brenhinkeller/32/36648_2.png) [@brenhinkeller](https://discourse.julialang.org/u/brenhinkeller)
#### Post date: [June 5, 2022, 8:20pm UTC](https://discourse.julialang.org/t/how-to-convert-mat-to-julia-matrix/82283/2 "2022-06-05T20:20:47Z")

</div>

I think normally `matread` returns a dictionary. Try using e.g. `keys(A)` to see what the available keys are and then extract one with, e.g. `A["some_key_value"]`
