help-octave
[Top][All Lists]
Advanced

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

Re: pass sting as function argument?


From: Avraham Rosenberg
Subject: Re: pass sting as function argument?
Date: Sat, 20 Sep 2008 07:13:01 +0300
User-agent: Mutt/1.5.17+20080114 (2008-01-14)

On Thu, Sep 18, 2008 at 11:24:42PM -0700, cube1982 wrote:
> 
> I'am trying to write a function to simply load a mat file and save its
> content in a text file. Here is my code:
> 
> function mat2txt(matfilename, textfilename)
> tmpfile = load matfilename;
> save -text textfilename tmpfile;
> endfunction
> 
> In the commandline, I typed the following line to call this function:
> > mat2txt('c:\octave\myfile\data1.mat', 'c:\octave\myfile\data1.txt');
> 
> But this doesn't work. Anyone can help me with this? 
> 

Hi,
I never used octave on MS windows, but knowing that octave is developed on
a Unix-like system, and knowing the way Unix treats the backslash, I would
suggest to try and use double back-slashes:
mat2tx('c:\\octave\\myfile\\data1.mat', 'c:\\octave\\myfile\\data1.txt');

I do not know how the MS windows version of octave reacts to ":" (the column
sign) in the file name. If possible, try to write the directories relative to
your working directory, to avoid using it.
Good luck, Avraham

-- 
Please avoid sending to this address Excell or Powerpoint attachments.


reply via email to

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