Prev: Need syntax to execute a matlab.m file from VB6
Next: add_block for name of Blockset with SPACES??!!
From: matlab_learner on 20 Feb 2010 23:24 i would need to call each point in an index notation, so like if i do L = linspace(-1,1,21) ; how can I do a loop over each point at L? or specify a condition? it does look easy but that is the trick to it? and i need to pass the values of L (at each point) to another variable (say w) so if i do w(i) = L(i) matlab says index has to be integer. please help me. thank u.
From: matlab_learner on 20 Feb 2010 23:45 so when i try to call the ith entry in L matlab would complain, saying: ??? Subscript indices must either be real positive integers or logicals. On Feb 20, 9:24 pm, matlab_learner <cib...(a)gmail.com> wrote: > i would need to call each point in an index notation, so like if i do > L = linspace(-1,1,21) ; > > how can I do a loop over each point at L? or specify a condition? > > it does look easy but that is the trick to it? > > and i need to pass the values of L (at each point) to another variable > (say w) > so if i do w(i) = L(i) > > matlab says index has to be integer. > > please help me. thank u.
From: matlab_learner on 20 Feb 2010 23:48 so when i try to call the ith entry in L matlab would complain, saying: ??? Subscript indices must either be real positive integers or logicals. On Feb 20, 9:24 pm, matlab_learner <cib...(a)gmail.com> wrote: > i would need to call each point in an index notation, so like if i do > L = linspace(-1,1,21) ; > > how can I do a loop over each point at L? or specify a condition? > > it does look easy but that is the trick to it? > > and i need to pass the values of L (at each point) to another variable > (say w) > so if i do w(i) = L(i) > > matlab says index has to be integer. > > please help me. thank u.
From: ImageAnalyst on 21 Feb 2010 00:14 Are you trying to do something like this: L = linspace(-1,1,21) ; % Loop over all values of L. % w will take on each and every value in L. for w = L disp(w); % Display values that w takes on. % Do any other stuff you want end
From: matlab_learner on 21 Feb 2010 00:30 Well, I want to be able to call each position in L. I could ideally do a loop over L (if i have no alternatives) or pass it to another variable say x. I am moving along a grid, from -1 through 1, in increments of 0.1 and will have 21 points, so i will have my solution at 21 points, and then these solution i would call into another vector or array and iterate on there.
|
Next
|
Last
Pages: 1 2 Prev: Need syntax to execute a matlab.m file from VB6 Next: add_block for name of Blockset with SPACES??!! |