help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reading ascii files in .mat format from Ox programming language


From: David Bateman
Subject: Re: Reading ascii files in .mat format from Ox programming language
Date: Thu, 15 Nov 2007 12:15:17 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

Riccardo Corradini wrote:
> Hi,
> all I would like to read an ascii file like this
>
> 2 3
> 1 2  6
> 2 3 45
>
> The first line contains the number of rows and the number of colons
> and the following lines contain the elements only separated by a space.
> Could anybody help me or give hints to write an octave function to
> read this type of files to place them into a matrix?
> Thanks a lot to all for your patience and help
> Riccardo
>
> ------------------------------------------------------------------------
> ------------------------------------------------------------------------
> L'email della prossima generazione? Puoi averla con la nuova Yahoo!
> Mail
> <http://us.rd.yahoo.com/mail/it/taglines/hotmail/nowyoucan/nextgen/*http://it.docs.yahoo.com/nowyoucan.html>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave

 fid = fopen(filename,"rt"); [v, c] = fscanf(fid, "%g", Inf);
fclose(fid); m = reshape (v(3:end), v(1), v(2))


-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

[Prev in Thread] Current Thread [Next in Thread]