From: Marco on 23 May 2010 07:14 Is it possible to have a function definition inside an m-file script? Thanks, Marco
From: Stefan Heinen on 23 May 2010 07:36 Marco <marcdein(a)gmail.com> wrote in message <60b7a368-2a0e-408d-92ec-160a4401644f(a)v37g2000vbv.googlegroups.com>... > Is it possible to have a function definition inside an m-file script? > > Thanks, > > Marco It is possible to have multiple functions in 1 m-file. function [y r]=bla(input) function z=blabla(y,r) Stefan
From: Stefan Heinen on 23 May 2010 07:40 Marco <marcdein(a)gmail.com> wrote in message <60b7a368-2a0e-408d-92ec-160a4401644f(a)v37g2000vbv.googlegroups.com>... > Is it possible to have a function definition inside an m-file script? > > Thanks, > > Marco hmm I justed tryed and a function in script didn't work :S. But you can write an other m-file with a function and than execute it in your script.
From: Marco on 23 May 2010 08:28 I would like to avoid having a collection of separate files - occasionally, for a demostration, it would be nicer to have all the functions one needs together with the script in a single file. Is it possible at least to have all the functions inside a single file, which is separate from the script m-file? Thanks, Marco
From: John D'Errico on 23 May 2010 09:04 Marco <marcdein(a)gmail.com> wrote in message <e2cf8f17-3720-4023-a8da-7938f4b3b1ff(a)q23g2000vba.googlegroups.com>... > I would like to avoid having a collection of separate files - > occasionally, for a demostration, it would be nicer to have all the > functions one needs together with the script in a single file. > > Is it possible at least to have all the functions inside a single > file, which is separate from the script m-file? No, no no. You cannot put functions inside SCRIPTS. Learn to use functions instead, creating toolboxes of your own functions. Heavy use of scripts is generally something to be avoided anyway. John
|
Next
|
Last
Pages: 1 2 Prev: Solving 2 non linear equations with 2 unknown Next: pause messing up my input |