How do I import a matrix into my matlab script code

210 visualizaciones (últimos 30 días)
Ruby
Ruby el 14 de Nov. de 2013
Comentada: Ruby el 14 de Nov. de 2013
A friend emailed me a file (.mat) which includes quite a large matrix (200x200). I need to take this matrix and insert it into my code which is a separate file (.m) How can I do this? Thank you

Respuesta aceptada

Umair Nadeem
Umair Nadeem el 14 de Nov. de 2013
You can put the .mat file in the same diectory as your m file and use load command to load the matrix in a variable.
For example
Matrix = load('Example.mat');
This will store the matrix from .mat file in the variable Matrix.
Hope this helps.
  1 comentario
Ruby
Ruby el 14 de Nov. de 2013
Thank you very much, exactly what I was looking for :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by