Sign in

Not a member? | Forgot your Password?

Search matlab

Search tips

Subscribe to matlab

Search tips

Free PDF Downloads

A Quadrature Signals Tutorial: Complex, But Not Complicated

Understanding the 'Phasing Method' of Single Sideband Demodulation

Complex Digital Signal Processing in Telecommunications

Introduction to Sound Processing

C++ Tutorial

Introduction of C Programming for DSP Applications

Fixed-Point Arithmetic: An Introduction

Cascaded Integrator-Comb (CIC) Filter Introduction

Discussion Groups

IIR Filter Design Software

See Also

Embedded SystemsFPGA

Discussion Groups | Matlab DSP | Manipulating filenames using functions

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread



Is this thread worth a thumbs up?

0

Manipulating filenames using functions - malcolm_graham2002 - Jul 5 6:40:00 2002

Does anyone know of an easy way (or any way) of manipulating m-file
names using a matlab function.

As a simple example: say I have a Simulink model which runs the m-
file 'file1.m'. Now I also have three other files
called 'file2.m', 'file3.m' and 'file4.m'. What I want to do is
somehow create a loop which runs the simulink model with file1, then
file2, then file3, etc., without manually changing the filename in
Simulink each time (eg. let's say I have 100 files!).

Any ideas?

Thanks,
Mal







Re: Manipulating filenames using functions - Sid - Jul 7 0:10:00 2002

Try using the eval command (u might have to use num2str as an arguement inside
the eval command)
malcolm_graham2002 <> wrote: Does anyone know
of an easy way (or any way) of manipulating m-file
names using a matlab function.

As a simple example: say I have a Simulink model which runs the m-
file 'file1.m'. Now I also have three other files
called 'file2.m', 'file3.m' and 'file4.m'. What I want to do is
somehow create a loop which runs the simulink model with file1, then
file2, then file3, etc., without manually changing the filename in
Simulink each time (eg. let's say I have 100 files!).

Any ideas?

Thanks,
Mal
_____________________________________
/groups.php3

Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
---------------------------------







Re: Manipulating filenames using functions - Andre Vehreschild - Jul 8 8:54:00 2002

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hey,

if you just need to concatenate a number use something like:

newname=[ basename, int2str(num) ];

for basename= 'file' and num= 42 this will result in

newname= 'file42'

If you need to do more complicated formating of the number, the
sprintf()-function may be worth a look. It works like in C.

Regards,

Andre
- --
Andre Vehreschild -- Institute for Scientific Computing, Aachen University
mailto: , phone: ++49- 241- 80- 24874
GnuPG-key available at http://www.sc.rwth-aachen.de/vehreschild
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9KVMwzVF62HujQtARAv0NAJ45wlzUSQnVLxk3MsvoOsndH0iHUACfZlN1
HNH2Ax30dYk3slA1GChl2VM=
=+1Vs
-----END PGP SIGNATURE-----