Thread Subject: open a file

Subject: open a file

From: Theo Kalfas

Date: 10 Feb, 2009 13:08:02

Message: 1 of 3

Hi,
I have a file result.mat which is in the folder work and it has 3 matrix.I want to open this file in my m-file which i have to read these matrix.How can i do that?With the fopen?
Thank you.

Subject: open a file

From: David

Date: 10 Feb, 2009 13:14:01

Message: 2 of 3

"Theo Kalfas" <k_thodoros@yahoo.gr> wrote in message <gmru7i$on0$1@fred.mathworks.com>...
> Hi,
> I have a file result.mat which is in the folder work and it has 3 matrix.I want to open this file in my m-file which i have to read these matrix.How can i do that?With the fopen?
> Thank you.

if its a .mat file created with the 'save' function, you get back the data with the 'load' command.

Subject: open a file

From: vedenev

Date: 10 Feb, 2009 14:12:56

Message: 3 of 3

Use load in format:
S=load('result.mat');

Then S will be structure with your data. If result.mat has matricies A
and B then you can get it as S.A and S.B

-----------------------------------------
Maxim Vedenev, MATLAB Custom Programming
vedenev@ngs.ru
http://simulations.narod.ru/

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
save David 10 Feb, 2009 08:15:07
load David 10 Feb, 2009 08:15:07
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com