How do I import a matrix into my matlab script code

조회 수: 204 (최근 30일)
Ruby
Ruby 2013년 11월 14일
댓글: Ruby 2013년 11월 14일
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

채택된 답변

Umair Nadeem
Umair Nadeem 2013년 11월 14일
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
Ruby
Ruby 2013년 11월 14일
Thank you very much, exactly what I was looking for :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by