f



Running M-File from Command Line?

Is there a way to invoke Matlab to run a single m-file?
The purpose is to be able to "build" matlab output files
from a make file.
-- 
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124
0
randy.yates (608)
9/23/2004 5:48:59 PM
comp.dsp 20331 articles. 1 followers. allnor (8509) is leader. Post Follow

4 Replies
979 Views

Similar Articles

[PageSpeed] 36

Randy Yates wrote:
> Is there a way to invoke Matlab to run a single m-file?
> The purpose is to be able to "build" matlab output files
> from a make file.


matlab -r matlab_cmd


I haven't done this since version 3.5 or so, so you might need to play 
with it.

matlab -help  does work for release 14 running in linux.
0
spam5118 (394)
9/23/2004 6:02:18 PM
Stan Pawlukiewicz <spam@spam.mitre.org> writes:

> Randy Yates wrote:
> > Is there a way to invoke Matlab to run a single m-file?
> > The purpose is to be able to "build" matlab output files
> > from a make file.
> 
> 
> matlab -r matlab_cmd
> 
> 
> I haven't done this since version 3.5 or so, so you might need to play
> with it.
> 
> 
> matlab -help  does work for release 14 running in linux.

Thanks Stan. The following did it:

matlab -r mymatlabfunction -nodesktop -nojvm -nosplash <exitcmd.txt

where "exitcmd.txt" is:

exit

It's MUCH faster getting in and out, too.
-- 
Randy Yates
Sony Ericsson Mobile Communications
Research Triangle Park, NC, USA
randy.yates@sonyericsson.com, 919-472-1124
0
randy.yates (608)
9/23/2004 6:12:17 PM
Randy Yates wrote:

> Is there a way to invoke Matlab to run a single m-file?
> The purpose is to be able to "build" matlab output files
> from a make file.

Can't answer this specific question, but if your m file is 
appropriately constrained, then you can certainly run it from 
octave at the command line.  I frequently use it from make files 
in exactly this way, for building dependent coefficient tables, 
and the like.

(Actually, I'm moving towards using Python for this purpose, 
because it's more readily available, thanks to simpler licence 
conditions.  It does have its own limitations, though, so the move 
is gradual...)

-- 
Andrew
0
9/23/2004 10:24:13 PM
> (Actually, I'm moving towards using Python for this purpose,

When we decide to use Platform like Python instead of Matlab,
we should not forget the running speed which is now very high in Matlab
because it can compile m-codes very effectively.
-- 
Best regards,
James K. (txdiversity@hotmail.com)
[Home] http://home.naver.com/txdiversity


0
9/28/2004 11:55:19 PM
Reply:

Similar Artilces:

multiple files in command line arguments or adding command line arguments to a running application
Hi, &nbsp; I want to be able to open more than one data file in my stand-alone labview application. I can open one file by using cmdarg variable just fine. I want to be able to either a) have multiple files in the cmdarg variable (I can parse them if they are appended into one string, but now windows is just giving me one file that i clicked even though I may have 3 of them selected in explorer) or b) add files one at a&nbsp;time by clicking them, but I want these files to be going to the same labview application (to be appended to the cmdarg?), not starting a new copy of the Labview application every time. &nbsp; I am not 100% that these things are not Windows problems, but there should be something that my application can do to change the way things work out. Thanks! &nbsp; Egor ...

Ignore the header running m file from command line
http://www.mathworks.com/matlabcentral/newsreader/view_thread/142342 The same exact question, except it didn't solve my problem... I don't want to save all the ouputs in a file. I would like to get rid off the header (matlab...) can I do that? Thanks.. ...

How to run different m.files from a m.file
Hy guys, I want to know how to run different m.files from a main m.file. I know if i put the name of a m.file in other m.file, it will execute, but i want a different application. I need a process that I can execute different m.files when I change the name of the m.file by a string variable. For example: a.m % first m.file x=1 b.m % second m-file x=2 c.m % third m.file test.m % main m.file str='a.m'; % I need a comand to execute a m.file from a str variable Regards, Tiago Sousa You'll need the eval() function to do that. "Tiago Sousa" <tas.tiago.sousa@gmail...

Running m-file within m-file
Is it possible to run another m-file within a m-file? like I will run an m-file and one of the commands in that m-file is to run another m-file. thanks Z Yes, you can. Just type in the name of your m file in your m-script. That's it.. That's it. "Zijia Li" <triplezzz21@gmail.com> wrote in message <gv1i1l$jhg$1@fred.mathworks.com>... > Is it possible to run another m-file within a m-file? > like I will run an m-file and one of the commands in that m-file is to run another m-file. > > thanks > Z ...

How to launch a M-File from the command line
Hello, I am trying to launch a M-File using the Matlab command line. Here is the command line as I enter it: matlab -nosplash -nodesktop -sd "C:\Program files\MATLAB\R2009b\toolbox\matlab\demos" -r superquad.m Matlab starts up in command line mode, but then gives the following error: ??? Undefined variable "superquad" or class "superquad.m". Is it because superquad.m is not on the MATLAB path ? If so, how do I add it to the path? I thought the -sd would take care of that. Assuming we can solve the first problem, 2 follow on questions: 1) Can I pass a comm...

Close M-file from command line?
Can you close M-files from command line? You can open the with EDIT or OPEN. What about closing them? I've wanted (for a long time) to have a function that could open and close "projects." In my daily work I switch between many projects and each may include many m-files. I'd like to be able to open and close the relevant m-files for a given project easily: >> project NAME open Which is easy enough to code, but I'd also like to close the project: >> project NAME close Thoughts? Daniel Ennis wrote: > > > Can you close M-files from command line? You can open the with > EDIT > or OPEN. What about closing them? I've wanted (for a long time) > to > have a function that could open and close "projects." In my daily > work I switch between many projects and each may include many > m-files. I'd like to be able to open and close the relevant > m-files > for a given project easily: > >>> project NAME open > > Which is easy enough to code, but I'd also like to close the > project: > >>> project NAME close > > Thoughts? Hi Daniel! Try this: % open crap.m com.mathworks.mlservices.MLEditorServices.openDocument('crap.m') % close crap.m com.mathworks.mlservices.MLEditorServices.closeDocument('crap.m') Should be pretty easy to step through your project-files and close them all. HTH PB Excellent. I'll only add that you need the full path...

how to run a command line command
lo there all i have an app that i want to launch an application from. i use linux with a bash shell. If i want to launch a program from my terminal, i use /myprogram or /home/myuser/myprogram how could i do something like this from a ruby script ? thanks sk On Mar 5, 12:22 pm, "shawn bright" <neph...@gmail.com> wrote: > lo there all > i have an app that i want to launch an application from. > i use linux with a bash shell. If i want to launch a program from my > terminal, i use > /myprogram > or /home/myuser/myprogram > > how could i do something l...

How to run a command upon exiting an m-file?
I have a situation where an m-file needs to be re-executed to sync with LabVIEW. Currently, when that situation arises I have it setup in a way that it will give a warning to the user ("MATLAB needs to be restarted. Please re-run the script.") and then it will exit the function. The user now needs to rerun the function by typing the name (RFSystem). Is it possible to somehow ask the main stack to run a command after the function ends running? That way I can ask the function to get the main program to run "RFSystem" *AFTER* is exits, so the program can rerun. I know that I can write another function (e.g. RunRFSystem) to control my RFSystem and if RFSystem exits with a specific flag it can run it again. Any other solutions besides that one that doesn't require another function? Thanks. Kian wrote: .... > I know that I can write another function (e.g. RunRFSystem) to control > my RFSystem and if RFSystem exits with a specific flag it can run it > again. Any other solutions besides that one that doesn't require another > function? What's wrong w/ the obvious and clean solution? -- ...

Executing M-files From OS Command Line
I have an M-file that I want to be able to run from my operating systems command line. Will matlab allow me to run an M-file without manually starting Matlab myself? Bill Scuba wrote: > > > I have an M-file that I want to be able to run from my operating > systems command line. Will matlab allow me to run an M-file > without > manually starting Matlab myself? Yes. You may run MATLAB from the command line, using the name of your m-file as a parameter. There are many switches you may be interested in, i.e. ones that turn off the Java interface. Search for COMMAND LINE. You...

Running a SQL file from OSQL command line utility
Hi, I have dumped a very large database from mysql (using mysqldump program) as a raw sql file. The reason was, convert this database to a MSSQL database. Since mysqldump creates the file as raw sql file with the database-table structures and the data in it, I thought using OSQL command line utilities should work to out this whole database in MSSQL server. I have run this command from command line: osql -u sa -i mysqldump.sql It is going since yesterday. It has been almost 36 hours that it's started. And in the mssql server, I see no database created yet. On the screen of the command line, I see bunch of numbers are going in order. I assume they are row numbers of the tables processed. But, if it is doing it, then where is it saving all this data ? I have checked the tempdb, pub db, other dbs, and I see no tables related to the database I am inserting. Will it populate it at the and of the job ? Or, am I doing something wrong here ? Regards. Murtix. Hi , You cant use that file (generated using MYSQLDUMP) directly in MSSQL using OSQL. This raw file can be used only in MYSQL incase you need a recovary. OSQL program can take only TSQL commands. The solution for you is: 1. Create a database in MSSQL server Manually 2. Use DTS to transfer Tables to MSSQL Server If your table size is very huge , generate a text file in MYSQL for each tables and use BCP IN to load inside MSSQL. Thanks Hari MCDBA "Murtix Van Basten" <nospam@nospam.org&g...

How to run Mathematica nb file in command line in windows?
How to run Mathematica nb file in command line in windows? For example, you can autorun a file.nb after double click a .bat file in windows I can not handle it well. Thanks On Sep 19, 2:38 am, timedcy <time...@gmail.com> wrote: > How to run Mathematica nb file in command line in windows? > For example, you can autorun a file.nb after double click a .bat file > in windows > I can not handle it well. > Thanks "C:\Program Files\Wolfram Research\Mathematica\7.0\Mathematica.exe" G: \data\birthday.nb "C" would be the drive where your programs are stored, it might be different if you have Mathematica installed somewhere other than its default installation. You need the quotes because of the spaces in the pathing to the executable file. G:\data\birthday.nb is the path and file name you want the executable to open. If this is not clear please contact me directly and I can explain in greater detail. Steven Shippee Olympia, Washington On 20 Sep, 10:41, shippee <slship...@gmail.com> wrote: > On Sep 19, 2:38 am, timedcy <time...@gmail.com> wrote: > > > How to run Mathematica nb file in command line in windows? > > For example, you can autorun a file.nb after double click a .bat file > > in windows > > I can not handle it well. > > Thanks > > "C:\Program Files\Wolfram Research\Mathematica\7.0\Mathematica.exe" G: > \data\birthday.nb &...

How to run a python script with a configuration file at command line ?
I have been searching for quite some times without success. I have a python script that needs to start from command line and it should have a config file to fill out the detais (itis one program, and many possible configurations). something as simple as PHP would be nice %> ./PHPscript -c configfile is there such a thing in Python? Andreas Jung wrote: > optparse > > is your friend. > > -aj > > 2010/6/3 steph_awk <stephane.larochelle@gmail.com > <mailto:stephane.larochelle@gmail.com>> > > I have been searching for quite ...

Keeping window open after running php file from the command line ?
Hi all, I was getting a 500 error and someone adviced me to run the php file from the command line to check what errors that would come up with. Great idea which I'd like to use, but when I use the Windows "run" box to do this, I see a window open and close so quickly that there's no way for me to read what's come up. How can I force the window to stay open after the program has finished ? Just in case it's needed, I run the tests on a Win XP machine with Apache. Thanks in advance, Juliette That's what the "DOS" /K switch is for. -- "jrf[no]" <"jrf[no]"@[spam]jokeaday.net> wrote in message news:419573ea$0$23087$ee9da40f@news.wanadoo.nl... > Hi all, > > I was getting a 500 error and someone adviced me to run the php file > from the command line to check what errors that would come up with. > > Great idea which I'd like to use, but when I use the Windows "run" box > to do this, I see a window open and close so quickly that there's no way > for me to read what's come up. > > How can I force the window to stay open after the program has finished ? > > Just in case it's needed, I run the tests on a Win XP machine with Apache. > > Thanks in advance, > Juliette > Jeb Hunter wrote: > That's what the "DOS" /K switch is for. > Hi Jeb, Thanks for your quick reply. Just wondering how to use it... If I enter t...

how to read a line from a file on command line
How to read a specific line from a file on command line ? For instance, I have file named test.txt, and I like to read the line 45, one single line only. Does any command I can retrieve the line 45 from the file text.txt ? Thanks. On Friday 18 July 2008 19:25, moongeegee wrote: > How to read a specific line from a file on command line ? > For instance, I have file named test.txt, and I like to read the line > 45, one single line only. > Does any command I can retrieve the line 45 from the file text.txt ? > Thanks. sed -n '45{p;q}' text.txt On 2008-07-18, moong...

Re: New user question re: running MoML files from command lines
Hi Mark, Sorry for the delay, I was on vacation. If you installed from the Windows installer, you can optionally install the sources as well. You would then need to install Cygwin, set the $PTII variable, run configure and make. Running make in $PTII/bin creates those ptolemy, ptexecute and vergil in $PTII/bin. The vergil.exe in $PTII that is installed by the Ptolemy II 5.0 Windows installer will still be operational. You mention that your PTII is set to the ptsupport.jar file. Usually PTII is set to the directory C:/Ptolemy/ptII5.0.1 In the windows installation, the CLASSPATH might be set to include ptsupport.jar _Christopher -------- Hi, I am attempting to work through Cha 7 of Vol 1 of the documentation, bu t do not have the required executables (ptolemy, ptexecute, vergil, & moml) i n $PTII/bin. I suspect I'm not going to be able to use these command-line programs without switching to a Cygwin installation (currently have the plain Windows installation). Is this indeed the case?--that I should instal l Cygwin and then re-install Ptolemy? Or maybe I just need to re-compile on m y machine? Actually, I don't really even have a $PTII/bin since my $PTII = "C:\Ptolemy\ptII5.0.1\ptolemy\ptsupport.jar!" which I suppose is also an aspect of the non-Cygwin Windows installation. I did search around in the archives for anything pertinent, but didn'...

problems with running SAINT (invalid key file) problems with running SAINT (invalid key file) problems with running SAINT (invalid key file) problems with running SAINT (invalid key file)
Hello, I downloaded Free Trial version of SAINT program. I have got two computers connected via net adapter. I set their IP's to 192.168.1.1 and 192.168.1.2 (Mandrake 9.0 both). These are numbers I typed when requested during downloading. Next I installed the program according to instructions present on your Website. Installation was completed successfully. Downloaded saint.key and IP numbers in the file agree with those typed. Copied it to saint-5.1.3 directory. Now, when I try to scan one of the computers following message shows up: 'Warning: Invalid Targets There was 1 invalid tar...

FAQ 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?
This message is one of several periodic postings to comp.lang.perl.misc intended to make it easier for perl programmers to find answers to common questions. The core of this message represents an excerpt from the documentation provided with Perl. -------------------------------------------------------------------- 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? Use the Tie::File module, which is included in the standard distribution since Perl 5.8.0. ------------------------------------------...

How to view what commands are run by an exe file as they are running
This may be a simple Google search job... but either I'm not sure what I'm = looking for or wording my search incorrectly. I am not a programmer. I am s= imply trying to install a program... and thought that a programming communi= ty would be a good place to come for help. My problem is this: I am trying to install a program that requires me to have a specific versio= n of another program installed before completing the install. When I run th= e .exe file, it goes through the normal steps until it checks to see if I h= ave a specific version of another program installed. I have this program in= stalled but, for whatever reason, it does not recognize that I have it inst= alled. So, I want to see where it is looking for that file. I don't want to edit t= he .exe file. I just want to know what commands the .exe is trying to run s= o I can see where it is looking. Maybe a "command" is a bad way to describe= what I'm looking for... not sure. If I can see where it is looking, I can = install the program into that directory. I'm hoping that would solve the pr= oblem.=20 I've read a few questions on here similar to this that were hammered by peo= ple criticizing the question and the person asking it... Please save the ef= fort. If my question is worded poorly, say that. If my question would take = to long to answer and/or would require a much higher level of skill than yo= u believe I can achieve... say that.=20 Thanks ...

Running command line commands in java program
We are trying to run a command line command, namely wget, in our java program. Is there a way to do something like 'wget http://www.cumtd.com'? ":)" <sadf@sadf.com> wrote: > We are trying to run a command line command, namely wget, in our java > program. Is there a way to do something like 'wget http://www.cumtd.com'? See the Runtime class (esp Runtime.exec(String command)) ":)" <sadf@sadf.com> wrote in message news:d0dc33$i85$1@news.ks.uiuc.edu... > We are trying to run a command line command, namely wget, in our java > program. Is there a way to do something like 'wget http://www.cumtd.com'? URLConnection con = new URL("http://www.cumtd.com").openConnection(); "If all you have is a hammer, everything looks like a nail" http://c2.com/cgi/wiki?GoldenHammer Don't be a victim. 99% of the time I've seen a system call or the use of JNI, it was for the wrong reason. -- Tony Morris http://xdweb.net/~dibblego/ I agree with the Runtime.exec method but it is not portable. Java's design was really built around the Unix model of processes, etc. and Windows command line programs are hindered by the lack of a true shell interpreter like Bash or the Korn Shell. Nonetheless, it is fairly simple to start a process up and monitor it's output. The difficulty I'm having is controlling external processes with Java. Perhaps this is asking to much of Runtime.exec. In any e...

Load .dat file while running m-file
Hi, I would like to load a .dat file while running a m-file, my problem is not how to make the program load a specific file, but to make the program ask for an input, where I choose wich file to run. I have tried the code: load input(['comment']) but matlab give me the error ??? Error using ==> load Unable to read file input(['comment']): No such file or directory. Error in ==> testloadmatrix at 11 load input(['comment']); Anyone know what I should do? Regards S?ren On Oct 28, 1:30=A0pm, "S?ren " <shenr...@student.aau.dk> wrote: > Hi, >...

FAQ 5.2 How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? #2 325998
This message is one of several periodic postings to comp.lang.perl.misc intended to make it easier for perl programmers to find answers to common questions. The core of this message represents an excerpt from the documentation provided with Perl. -------------------------------------------------------------------- 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? Use the Tie::File module, which is included in the standard distribution since Perl 5.8.0. ------------------------------------------...

FAQ 5.2 How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? #2 554047
This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? Use the Tie::File module, which is included in the standard distribution sinc...

FAQ 5.2 How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? #3 554638
This is an excerpt from the latest version perlfaq5.pod, which comes with the standard Perl distribution. These postings aim to reduce the number of repeated questions as well as allow the community to review and update the answers. The latest version of the complete perlfaq is at http://faq.perl.org . -------------------------------------------------------------------- 5.2: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? Use the Tie::File module, which is included in the standard distribution since Perl 5.8.0. -------------------------------------------------------------------- The perlfaq-workers, a group of volunteers, maintain the perlfaq. They are not necessarily experts in every domain where Perl might show up, so please include as much information as possible and relevant in any corrections. The perlfaq-workers also don't have access to every operating system or platform, so please include relevant details for corrections to examples that do not work on particular platforms. Working code is greatly appreciated. If you'd like to help maintain the perlfaq, see the details in perlfaq.pod. -- Posted via a free Usenet account from http://www.teranews.com ...

Sending a file file to printer using command line
Hi, I want to print a file using servlet/JSP through command line. For this should I call the *.dll file of the printer driver? Also I want to give the i/p file name and o/p file name as arguments to the printer. Is it possible? How to go about it? Thanks in advance. On Apr 20, 12:11 pm, ruds <rudra...@gmail.com> wrote: .... > I want to print a file using servlet/JSP through command line. You want to print a file from the server running your Web app? > For this should I call the *.dll file of the printer driver? You want to print a file from the *Windows* server running your W...

Web resources about - Running M-File from Command Line? - comp.dsp

Running - Wikipedia, the free encyclopedia
This article is about the type of locomotion in humans. For running in horses, see Horse gait . For locomotion in dogs, see Gait (dog) . For ...

If you think Mark Zuckerberg running through smoggy Beijing without a mask is bad, wait until you see ...
VIDEO: The Internet was quick to shame Facebook CEO Mark Zuckerberg for jogging through the smoggy streets of Beijing without a mask. But the ...

Apple is running out of reasons to not upgrade the iPhone’s display to AMOLED
... and better power efficiency compared to LCD, but they're almost more expensive to mass produce. That said, it looks like Apple is now running ...

TIME IS RUNNING OUT: Obama's Final Solution for Israel
... to impose those same terms on the Jewish State. Netanyahu has tried to run out the clock on Obama. Now that the clock is actually running out, ...

Sanders Second-Half Comeback Plans Running Into Tougher Primary Calendar
Big-state primaries next on the calendar have been the Vermont senator's weakest link.

Pilot charged for running brothels in Houston area
Bruce Wayne Wallis allegedly ran more than six brothels

Sanders' second-half comeback plans running into tougher primary calendar
After routing Hillary Clinton in three western-state Democratic caucuses, Bernie Sanders still faces daunting delegate math and a road ahead ...

PHOTO GALLERY: Stars live monkishly at Kenyan running camp
KAPTAGAT, Kenya (AP) — The hand-written roster — misspelled "rosta" — tells the runners when it's their turn for communal chores. Stephen Kiprotich's ...

Kids off and running for Easter eggs in Camas
CAMAS Children scrambled across the grass Sunday afternoon at Crown Park, swooping up plastic Easter eggs. Parents and grandparents stood on ...

Tim Tebow Says He’d Be Open To Running For Political Office
Tim Tebow Says He’d Be Open To Running For Political Office

Resources last updated: 3/30/2016 5:06:26 AM