From: Adam Thibideau on 26 Jul 2010 20:07 Hi there, First of all, thanks so much to everyone who has been helping me with my code so far; you have been so helpful! Okay, now that i have my code working nicely i want to run it several times in a row with various input parameters. My function analyzes data and outputs a struct based on the input parameters and I want to have it provide output for several different inputs. In the command console it would look like this: >> interval_1min = myFunction(1) >> interval_2min = myFunction(2) >> interval_3min = myFunction(3) .. .. .. and I want to do this for a bunch of different inputs but each time it takes about 2hrs so I want it to do a bunch of them overnight. I hope this is clear. I'm pretty sure it is simple to do this with an m-file or something but I am a MATLAB beginner so I dont know the best way to go about it. Thanks in advance!!
From: TideMan on 26 Jul 2010 20:46 On Jul 27, 12:07 pm, "Adam Thibideau" <adam.thibid...(a)gmail.com> wrote: > Hi there, > > First of all, thanks so much to everyone who has been helping me with my code so far; you have been so helpful! > > Okay, now that i have my code working nicely i want to run it several times in a row with various input parameters. My function analyzes data and outputs a struct based on the input parameters and I want to have it provide output for several different inputs. > > In the command console it would look like this: > > >> interval_1min = myFunction(1) > >> interval_2min = myFunction(2) > >> interval_3min = myFunction(3) > > . > . > . > > and I want to do this for a bunch of different inputs but each time it takes about 2hrs so I want it to do a bunch of them overnight. I hope this is clear. I'm pretty sure it is simple to do this with an m-file or something but I am a MATLAB beginner so I dont know the best way to go about it. > > Thanks in advance!! Don't do this!! Read this: http://matlabwiki.mathworks.com/MATLAB_FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F
From: Adam Thibideau on 26 Jul 2010 21:09 > Don't do this!! > > Read this: > http://matlabwiki.mathworks.com/MATLAB_FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F Thats not what i want though. I want the output from each iteration of my function to be assigned to a variable. I want to have the code get executed overnight just as if I was sitting beside the computer and typing in the next command when the previous one finished. Understand?
From: Judy on 26 Jul 2010 21:37 "Adam Thibideau" <adam.thibideau(a)gmail.com> wrote in message <i2lbjf$ie1$1(a)fred.mathworks.com>... > > > Don't do this!! > > > > Read this: > > http://matlabwiki.mathworks.com/MATLAB_FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F > > > Thats not what i want though. I want the output from each iteration of my function to be assigned to a variable. I want to have the code get executed overnight just as if I was sitting beside the computer and typing in the next command when the previous one finished. Understand? How about a while or for loop that just loops the number of functions or whatever you want to do? Each loop, you could be reading an input with your function parameters. Make sure that for ever output, you save it (use save for variables or saveas for figures) and close it, or else MATLAB will get bogged down quickly.
From: TideMan on 26 Jul 2010 22:15 On Jul 27, 1:09 pm, "Adam Thibideau" <adam.thibid...(a)gmail.com> wrote: > > Don't do this!! > > > Read this: > >http://matlabwiki.mathworks.com/MATLAB_FAQ#How_can_I_create_variables... > > Thats not what i want though. I want the output from each iteration of my function to be assigned to a variable. I want to have the code get executed overnight just as if I was sitting beside the computer and typing in the next command when the previous one finished. Understand? I understand, but what I'm saying is that you should NOT assign the output to variables defined like that. And I gave you that reference in the FAQ because it not only shows how to assign variables correctly, but also shows a for loop, which is what you're looking for. Did you not grasp that when you read the FAQ?
|
Next
|
Last
Pages: 1 2 Prev: patch object in GUI exceeds axes Next: Convert Simulink mdl to CUDA for GPU computing? |