help-octave
[Top][All Lists]
Advanced

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

Input files to function script


From: SalveH
Subject: Input files to function script
Date: Sun, 27 Feb 2011 14:11:35 -0800 (PST)

I have a function script kalled named sppl.m that I run from octave command
line with many wav-files as input.

%%%%%
function sppl (varargin)
for i = 1:length (varargin)
  file = varargin{i};
  ...

%%%%%

The function works well used like this:
octave:> sppl "file1.wav" "file2.wav" "file3.wav"
but I'd like to be able to do something similar to the shell:
bash> script file*wav
to avoid all that typing!

I've been told that by using functions such as 'dir' or 'ls' or 'glob' etc.
this should be possible. Somehow ..

(I've tried something like this:
octave:> files = dir ("*wav")
octave:> sppl (files)
I understand why THAT don't work. Probably each file has to be referred to
as files(n).name. But I can't get that to work either..)

I now give up and need HELP!


-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Input-files-to-function-script-tp3327208p3327208.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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