f

#### double loops

```Hi,

I am new in Matlab and I have to creat a moving window to make calculations for my research. I did it with the help of double loop which looks like this:

for c=417:500
for j=1:c

matrix(:,:,j,c)=y(:,j)*y(:,j)'-S(:,:,c)
end
end
where "y" is 21 by 500 matrix of data, S is 21 by 21 by 500 matrix of data

The problem is that as "c" starts from 417, MATLAB first calculate 417 matrixes of "0" (number of "j") for 1:417 times (number of "c"). Only after that it starts to calculate the data that I need (for "c" equal from 417 to 500). Calculation of these first matrixes of "0" take long time, so does anybody know how to create a code which will start directly from 417 so I can speed up a process?

Katerina
```
 0
10/16/2009 11:34:04 PM
comp.soft-sys.matlab 210103 articles. 11 followers. lunamoonmoon (258) is leader.

1 Replies
221 Views

Similar Articles

[PageSpeed] 6

```On Oct 16, 7:34=A0pm, "Ekaterina Ipatova" <eipat...@list.ru> wrote:
> Hi,
>
> I am new in Matlab and I have to creat a moving window to make calculatio=
ns for my research. I did it with the help of double loop which looks like =
this:
>
> for c=3D417:500
> for j=3D1:c
>
> =A0 =A0 matrix(:,:,j,c)=3Dy(:,j)*y(:,j)'-S(:,:,c)
> =A0end
> end
> where "y" is 21 by 500 matrix of data, S is 21 by 21 by 500 matrix of dat=
a
>
> The problem is that as "c" starts from 417, MATLAB first calculate 417 ma=
trixes of "0" (number of "j") for 1:417 times (number of "c"). Only after t=
hat it starts to calculate the data that I need (for "c" equal from 417 to =
500). Calculation of these first matrixes of "0" take long time, so does an=
ybody know how to create a code which will start directly from 417 so I can=
speed up a process?
>
>
> Katerina =A0

-------------------------------------------------------------------------
Katerina  :
I can't really tell what you're doing.  You have 2D and 3D matrices
and then end up with a 4D matrix.  Too complicated for me to figure
out.  I'm not that good at visualizing hyper-dimensional image space.
I don't know what that 4 dimensional array means.  Can you explain
what you want to do in words?  Do you want to do something like a
convolution or a sliding window type of filter?  As a wild guess,
maybe you can check out these functions:
bsxfun(), convn(), imfilter()
-ImageAnalyst
```
 0
imageanalyst (7624)
10/17/2009 12:38:52 AM

Similar Artilces:

Matlab parallel for loop or Matlab open pool
I am trying to to some computations and I would like to do it in parallel using parfor or by Opening the matlabpool.. as the current implementations is too slow: result=zeros(25,16000); for i = 1:length(vector1) % length is 25 for j = 1:length(vector2) % length is 16000 temp1 = vector1(i); temp2 = vector2(j); t1 = load(matfiles1(temp1).name) %load image1 from matfile1 t2 = load(matfiles2(temp2).name) % load image2 from matfile2 result(i,j)=t1.*t2 end end It work fine but I would really like to know if there is a way to speed thing up ... Thanks a lot in advance! ...

for loop into for loop.
Hello this is my first time that i am writing here.. I need your help to improve my code. This is my code for a=1:numberOfShortestPaths for b=a+1:a+numberOfShortestPaths for c=b+1:b+numberOfShortestPaths for d=c+1:c+numberOfShortestPaths for e=d+1:d+numberOfShortestPaths total_weight=weight(:,:,a)+weight(:,:,b)+weight(:,:,c)+weight(:,:,d)+weight(:,:,e); maximum=max(total_weight); end end end end end i want to do this function "automatically" because the letters are depending from other parameter(number of calls). in this example the number of calls=5. if the number=4 the for loops would be until 'd'.. i dont know how to write the code to do this automatic and not manually like that one Do you have any ideas to recommend me? Thanks in advance Zack Zack: I think you need to look into recursive programming. The function would call itself. You'd have to pass along the information as to when the function should "bail out", in other words, backtrack out or recurse out. "zak " <zaxos_pele@hotmail.com> wrote in message <ir5dgd\$12q\$1@newscl01ah.mathworks.com>... > Hello this is my first time that i am writing here.. > I need your help to improve my code. This is my code > > for a=1:numberOfShortestPaths > for b=a+1:a+numberOfShortestPaths > for c=b+1:b+numberOfShortestP...

loops in loops
In the attached vi, the one second loop runs at one second and can't be touched.&nbsp; In the ten second loop, the ten second clock is a stand in for a process that generates a finished signal. The problem is once the process is complete, to start it again, leave the one second loop running, and start an additional process that will take less time than 10 seconds. thanks internal loops.vi: http://forums.ni.com/attachments/ni/170/319512/1/internal loops.vi Hi exo, what do you try there? If you start your vi, the value from your stop button will be read and after that, both loops "one" second and "ten" second won�t notice the state change of the stop button. Can you please explain, what you try to do?? Mike Okay, let me try again. I need three loops. Two loops start at the same time one runs fast one runs slow. The slow one is probably independent to the problem. When the second loop is done, it needs to restart and start a third loop that takes less than the second. You have a very basic dataflow problems. Unfortunately, I don't understand your description. &nbsp; I would recommend starting with some basic LabVIEW tutorials. &nbsp; Here are some&nbsp;obvious mistakes: - Your loop cannot read changes in the stop button, because the terminal is outside the loop. - You reset "internal loop" to zero in parallel to the loops. You cannot guarantee that this will happen before the locals are read so you might have a race c...

LOOP and +LOOP
With LOOP, since the index (I) increases by 1 with each loop iteration, we can test for equality as a means to determine if it's time to exit the loop or not: : TEST 10 0 DO I . LOOP ; TEST 0 1 2 3 4 5 6 7 8 9 Here, when I gets to 10, the loop exits. It's not so easy with +LOOP, since the index can be changed by any arbitrary value on each iteration: : TEST 100 0 DO I . RANDOM +LOOP ; Here, we cannot test for equality. We have to test for crossing a boundary instead, at least as far as I can see. With that in mind, are these following results correct: : TEST 10 0 DO I . 1 +LOOP ; TEST 0 1 2 3 4 5 6 7 8 9 10 (11 iterations) : TEST 10 0 DO I . 3 +LOOP ; TEST 0 3 6 9 (4 iterations) : TEST -30 -7 DO I . -3 +LOOP ; TEST -7 -10 -13 -16 -19 -22 -25 -28 (8 iterations) Regards Mark On Nov 25, 10:34=A0pm, MarkWills <markrobertwi...@yahoo.co.uk> wrote: > With LOOP, since the index (I) increases by 1 with each loop > iteration, we can test for equality as a means to determine if it's > time to exit the loop or not: > > : TEST 10 0 DO I . LOOP ; > TEST > 0 1 2 3 4 5 6 7 8 9 > > Here, when I gets to 10, the loop exits. > > It's not so easy with +LOOP, since the index can be changed by any > arbitrary value on each iteration: > > : TEST 100 0 DO I . RANDOM +LOOP ; > > Here, we cannot test for equality. We have to test for crossing a > boundary instead, at least as far as I can see. > > With that in mi...

while loop in a while loop
Hi all, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I am trying to write a program with a while loop within another while loop. When I run the vi both while loops&nbsp; run but then only the inner while loop seems to update, I adjust controls and they have no effect on the indicators. &nbsp; Thanks.. The outer while loop will not update until the inner while loop finishes, at which point the whole dance will start again You need to familiarize with the concept of dataflow programming. Run your VI in "execution highligthing" mode while watching the diagram and you'll get a better feeling on how things work. :) &nbsp; If both loops need to run in parallel, place them next to each other without data dependency. &nbsp; Can you explain what you are trying to do? :) So is it a bad idea to have one within the other if I was them to run simultaniously? Should I put the two whileloops side by side? I have attached the block diagram Thanks &nbsp; Block Diagram.JPG: http://forums.ni.com/attachments/ni/170/319250/1/Block Diagram.JPG sparrowroad wrote:So is it a bad idea to have one within the other if I was them to run simultaniously? Should I put the two whileloops side by side? I have attached the block diagram It all depends what your program should do There are scenarios where stacked loops are appropriate. Typically, one loop is sufficient if you want to run most of the code at 500ms interval, but some p...

DO
Hi all. I need a control loop that I would code in C++ like do { // Do the job } while (condition == true); I can't find any hints of similar constructs in the documentation of WHILE. (I'm using R2006a, if these things have been reworked in recent years.) Any suggestions how to do this? Rune Rune Allnor <allnor@tele.ntnu.no> wrote in message <b7bf783f-6367-4e24-adcf-10f34269a7e9@z41g2000yqz.googlegroups.com>... > Hi all. > > I need a control loop that I would code in C++ like > > do { > // Do the job > } while (condition == true); > > I can't find any hints of similar constructs in the documentation > of WHILE. (I'm using R2006a, if these things have been reworked > in recent years.) > > Any suggestions how to do this? > > Rune I'm so cornfused. (Is this April first?) Why would not this serve your purpose? while condition % Do the job end John On 6 Feb, 12:16, "John D'Errico" <woodch...@rochester.rr.com> wrote: > Rune Allnor <all...@tele.ntnu.no> wrote in message <b7bf783f-6367-4e24-ad= cf-10f34269a...@z41g2000yqz.googlegroups.com>... > > Hi all. > > > I need a control loop that I would code in C++ like > > > do { > > // Do the job > > } while (condition =3D=3D true); > > > I can't find any hints of similar constructs in the documentation > > of WHILE. (I'm using R2006a, if these things have...

double for loop
Hi, &nbsp; I am trying to modify the content of a 2D for loop using a double for loop. But the result I am getting is always 0 in the loop i am getting... I am not really too sure of the problem. Can anyone help? &nbsp; Thanks &nbsp; &nbsp; example2.vi: http://forums.ni.com/attachments/ni/170/215997/1/example2.vi ...

30% faster for-loop when changing loop variable from default(double) to int
When testing a very simple program and trying to change the for-loop variable from double to int (Why did I do that?), I found the program becomes faster, about 30%. The program is as following: function k=pbug_d(N) p=0.3; for i=1:N p=3.4*(p*(1-p)); end k=p; end On my PC (Pentium 6700, Win7, MatlabR2010b), the command tic, pbug_d(1e9),toc took 9.3s. When I changed the for-loop variable to int type: function k=pbug_i(N) p=0.3; i=int32(1); for i=1:N p=3.4*(p*(1-p)); end k=p; end the command tic, pbug_i(int32(1e9)),toc %the input type should also be int gave the same result(ans= 0.451963247626153) and took only 6.6s, ~30% faster! This result sounds good. A simple data type change brings 30% better performance. I also tested them under Linux (Ubuntu 12.04, LTS, MatlabR2010b) and got the similar result. While when I compiled the .m file into mex file, there is little difference for int and double for-loop variable. In linux, the compiled mex using int loop variable even becomes a little slower than double type. Anyone knows why? "Hao Song" wrote in message <jor8fr\$a4n\$1@newscl01ah.mathworks.com>... > When testing a very simple program and trying to change the for-loop variable from double to int (Why did I do that?), I found the program becomes faster, about 30%. > The program is as following: > > function k=pbug_d(N) > ...

Nested FOR loops. (a loop within a loop)
I can't get my head around them. I have two MySQL tables, one contains the categories, the other contains the posts. Each post is linked to a category. Now I'm trying to display each post with a drop down menu that has the categories in it and have the category that the post is in selected. Here's my code for the drop down menu where my woes lie. for (\$i=0; \$i<count(\$posts); \$i++) { for (\$j=1; \$j<=count(\$categories); \$j++) { if (\$j == \$post[\$i]['id']) { selected = ' selected="selected"'; } else { selected = ''; } \$category_list .= '<option value="' . \$j . '"' . \$selected . '>' . \$cat_name[\$j] . '</option>'; } unset(\$j); \$dropdown .= '<td><select name="' . \$cat_name[\$i]['name'] . '">'. \$category_list . '</select></td>'; } Here's my problem, for ease, lets say I have 2 categories and 100 posts. For post one I have 2 categories in the menu. For the next post I have 4 categories in the menu (the 2 have been doubled), for the third I have 6 (tripled), and so on. Each post after the next has another 2 categories added. So the drop down menu for post 100 has 200 categories listed. Just the same two repeated over and over. The output should look like this, though an <option> for each category, but just two for this example....

what diference between timed loop and while loop and for loop
If I want to count 2 second working in the loop and next then going out of the loop I don't know&nbsp;which the loop &nbsp;I can use Message Edited by Jairak on 07-26-2008 03:14 PM Why do you need a loop to count for 2 seconds? To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's <a href="http://zone.ni.com/devzone/cda/tut/p/id/5054" target="_blank">Learning Center</a> which provides links to other materials and other tutorials. You can also take the <a href="http://www.ni.com/academic/lv_training/how_learn_lv.htm" target="_blank">online courses</a> for free. Hi, &nbsp; From the information you have provided, I don't know exactly what you are trying to do. However, if you want a loop to iterate once, wait until two seconds and then exit the loop, use the "Wait Until Next ms Multiple" function, wire in a numeric constant "2000" and wire a boolean true constant to the loop condition of the while loop to iterate once, or use a for loop with "1" wired into the loop count. &nbsp; Perhaps you need to elaborate your question. Plus, check out the context help (press Ctrl + H) for a consice report on each of the loops. &nbsp; Regards, Jairak wrote: If I want to count 2 second working in the loop and next then going out of the loop I don't know&nbsp;which the loop ...

Problem in double while loop
Hi, &nbsp; I'm having a problem using double while loop. &nbsp; I put my program in a while loop where the condition is set to:" continue if true". &nbsp; this while loop is put in another while loop(as i want the user to interact with the program). The outer while loop is set to constant false and condition stop if true. &nbsp; i'm having a problem as i'm unable to display the result. Please help me. &nbsp; Attached is the diagram. I'musing llabview 7.0. &nbsp; Thanks. doublewhileloop.JPG: http://forums.ni.com/attachments/ni/170/249813/1/doublewhileloop.JPG Hi aaz, &nbsp; The reason your program never displays the result is because it will never stop the outer loop and proceed with sending the value to the indicator. &nbsp; There doesn't seem to be a reason for the outer loop.&nbsp; Why do you have one?&nbsp; &nbsp; As for the inner loop, it will only execute once if the control has a value other than 4.&nbsp; If it is 4, then it will run forever.&nbsp; Avoid such a scenario.&nbsp; Actually, avoid scenarios which would keep a loop running foever, which is the case for both your loops. &nbsp; Here is the reason you gave for the dual loop:&nbsp; "this while loop is put in another while loop(as i want the user to interact with the program). The outer while loop is set to constant false and condition stop if true." &nbsp; I do not see any user interaction in the inner...

how can i do it in loop in matlab?
Hi, I have a sample date which is a 1000*8 matrix. i want to extract raws and c= olumns put them into new matrices, i need to assign the name of those new m= atrices automatically (names of matrices is s1,s1,...,s20), how can i do th= at? i used the following codes but it gave me an error! data=3Dload('case1.dat'); for i=3D1:20; for j=3D1:length(data) if data(j,1)=3D=3Di; eval['s' num2str(i)(j,:)]=3Ddata(j,:); end=20 end end Thank you very much. Best regards, Mathias ...

Logical loop in Matlab?
Dear All, is it possible in Matlab to create a logical loop which circulates till the logic assumption become true (gets the value 1)? thx Prediger "Prediger" <prediger@freemail.hu> wrote in message news:1711585907.117240.1265392623408.JavaMail.root@gallium.mathforum.org... > Dear All, > > is it possible in Matlab to create a logical loop which circulates till > the logic assumption become true (gets the value 1)? Use a WHILE loop. -- Steve Lord slord@mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ thanks Steven! ...

slow for loop in MATLAB
Hi, I have the below part in my script in order to make analysis with support vector machines using the libsvm through matlab, in my thesis for the master's degree. I use logs instead of normal values, as you can see, so all the values for c and g are exponents of 2 (2^15 & 2^20 - 2^-10 & 2^-5) But especially in the calculations of c, near 20 and above, matlab is getting very slow, in completing the running with the below setting, which it takes at least 2 days. Is there any other way to write the below part with different means like matrices in order to gain in time? Could you help me? fold = 10; c_begin = 15; c_end = 20; c_step = 0,1; g_begin = -10; g_end = -5; g_step = 0,1; bestcv = 0; bestc = 2^c_begin; bestg = 2^g_begin; i = 1; j = 1; for log2c = c_begin:c_step:c_end for log2g = g_begin:g_step:g_end cmd = ['-v ',num2str(fold),' -c ',num2str(2^log2c),' -g ',num2str(2^log2g)]; cv = svmtrain(label,inst,cmd); if (cv > bestcv) || ((cv == bestcv) && (2^log2c < bestc) && (2^log2g == bestg)) bestcv = cv; bestc = 2^log2c; bestg = 2^log2g; end disp([num2str(log2c),' ',num2str(log2g),' (best c=',num2str(bestc),' g=',num2str(bestg),' rate=',num2str(bestcv),'%)']) Z(i,j) = cv; j = j+1; end j = 1; i = i+1; end xlin = linspace(c_begin,c_end,size(Z,1)); ylin = linspace(g_begin,g_end,size(Z,2)); [X,Y] = mes...

vectorising double loops
Hi there, Can someone please show me how to vectorise this double loop? for i = 1:N for j =1:N mu=-0.5*(Vol(i)*fwd(t)^(Beta-1)*sqrt_dt)^2+(Vol(i)*fwd(t)^(Beta-1)*sqrt_dt)*rho*(((Log_Vol(j)-Log_Vol(i))+0.5*(nu_sqrt_dt) ^2)/nu_sqrt_dt); sigma=(Vol(i)*fwd(t)^(Beta-1)*sqrt_dt)*rho2; Con_Prob_FwdRtn(i,j)=normpdf((Log_Fwd(t+1)-Log_Fwd(t)),mu,sigma); JP(i,j)=Con_Prob_FwdRtn(i,j)*Con_Prob_VolRtn(i,j)*Prob(i); Sum=Sum+wi*wj*JP(i,j); end end "Hugh" wrote in message <iuq651\$m4v\$1@newscl01ah.mathworks.com>... > Hi there, > > Can someone please show me how to vectorise this double loop? > > for i = 1:N > > > > for j =1:N > > > > mu=-0.5*(Vol(i)*fwd(t)^(Beta-1)*sqrt_dt)^2+(Vol(i)*fwd(t)^(Beta-1)*sqrt_dt)*rho*(((Log_Vol(j)-Log_Vol(i))+0.5*(nu_sqrt_dt) ^2)/nu_sqrt_dt); > > sigma=(Vol(i)*fwd(t)^(Beta-1)*sqrt_dt)*rho2; > > Con_Prob_FwdRtn(i,j)=normpdf((Log_Fwd(t+1)-Log_Fwd(t)),mu,sigma); > > JP(i,j)=Con_Prob_FwdRtn(i,j)*Con_Prob_VolR...

Probelm with matlab loops
Hi. I'm doing a program that control's 3 motor's. I have 3 start (start1, start2, start3) button , and each of them has a while loop. The problem is , when i try to start more than one. Becouse when I for example, press the start1 button (the loop on start1 is going on) , but when i press the start2 button, the loop in start1 is interrupted by the start2, and only start2 is working. Anyone knows how to solve this problem?. On 1/5/2012 4:31 AM, Lukasz K wrote: >Becouse when I for example, press the start1 button (the loop on start1 is going on) , but when >i press the start2 button, the loop in start1 is interrupted by the start2, and only start2 is working. > > Anyone knows how to solve this problem?. You mean you want the 3 loops to be running in parallel? may be you need the parallel computing toolbox then http://www.mathworks.com/products/parallel-computing/ good luck --Nasser "Nasser M. Abbasi" <nma@12000.org> wrote in message <je3vhb\$ro8\$1@speranza.aioe.org>... > On 1/5/2012 4:31 AM, Lukasz K wrote: > > >Becouse when I for example, press the start1 button (the loop on start1 is going on) , but when > >i press the start2 button, the loop in start1 is interrupted by the start2, and only start2 is working. > > > > Anyone knows how to solve this problem?. > > You mean you want the 3 loops to be running in parallel? > > may be you need the parallel computing toolbox the...

loop in Matlab #2
Hello, I am very stupid to ask this. I have a matrix A and want a new matrix B. I explained below what it is: A= 1 y1 2 y2 3 y3 4 y4 B= -2 y4 5 y5 I want to transform -1 y5 6 y6 ---------------------------------------------> 0 y6 7 y7 only X coordinates +1 y7 8 y8 and out put matrix +2 y8 9 y9 have this form +3 y9 10 y10 +4 y10 11 y11 12 y12 the provided info: index boundaries (upper and lower, here 4 & 10) and index to be set zero (here 6). I would like to know how to implement this in Matlab where upper, lower and index-set-zero should be variable. Can Anyone help me. Awaiting for your response. Thanks Somnath Karmakar wrote: > Hello, I am very stupid to ask this. I have a matrix A and want a new > matrix B. I explained below what it is: ....elided for brevity... > the provided info: index boundaries (upper and lower, here 4 & 10) > and index to be set zero (here 6). I would like to know how to > implement this in Matlab where upper, lower and index-set-zero should > be variable. Can Anyone help me. Awaiting for your response. Thanks >> % straight-ahead solution >> a=[(1:1...

Matlab Loop Index
Hi all, I am having trouble implementing a loop in matlab, the following piece of code displays a graph that looks like a quarter of a dart board, with the bullseye in the bottom left hand corner. What I would like is it to display the centre of the 'dartboard' in the centre of the grid. E_data = zeros(150); for j=1:150, for i=1:150, x=i/1000; y=j/1000; phi=atan((z^(-1))*sqrt(x^2+y^2)); IN=exp(-log(2)*(((abs(phi))/29)^2))+0.11*exp(-log(2)*(((abs(phi)-45)/21)^2)); E_data(i,j)= ((120*z)/((x^2 + y^2 + z^2)^1.5))*IN; end end contourf(E_data) The following is some of the code that I have tried. However, it seems to create some sort of infinite loop because my Matlab just keeps displaying busy. I'm not sure what exactly I'm doing wrong, if someone could point me in the right direction I would be very grateful! m=0; n=0; for j=-75:1:74, n=n+1; for i=-75:1:74, m=m+1; x=i/1000; y=j/1000; phi=atan((z^(-1))*sqrt(x^2+y^2)); IN=exp(-log(2)*(((abs(phi))/29)^2))+0.11*exp(-log(2)*(((abs(phi)-45)/21)^2)); E_data(m,n)= ((120*z)/((x^2 + y^2 + z^2)^1.5))*IN; end end I realise that another reason this will not work is because matlab won't allow 0 to be an index! On 3/12/2011 12:39 PM, Arla wrote: > Hi all, > > I am having trouble implementing a loop in matlab, the following piece of code displays a graph > that looks like a quarter of a dart board, with the bull...

Hi all! I have a trouble about this. I use loop function (for a : b ) for simulating my program but if the combination (b) get higher, the simulation get slowly. So, how to speed up the simulation with the loop? any function in matlab which can use for this case? Thank you On 5/26/2012 6:31 AM, azer hape wrote: > Hi all! > I have a trouble about this. I use loop function (for a : b ) for > simulating my program but if the combination (b) get higher, the > simulation get slowly. So, how to speed up the simulation with the loop? > any function in matlab which can use for this case? > Thank you No can help w/o knowing far more than you've posted...you haven't even told us what a, b are (altho that may not be terribly important, it is certainly a question). More than likely it's something to do with what is in the loop...common areas of trouble are not preallocating arrays and the like. Use the profiler to find a bottleneck. -- ...

how to vectorize a double loop
Hi There, How do you vectorize this code? for i=n:-1:1 for j=1:(2*i-1 ) s(j) = s(j)*edx; C(j) = max(disc*(pu*C(j)+pm*C(j+1)+pd*C(j+2)),K-s(j)); end end Thanks Dear Luigi! > How do you vectorize this code? > > for i=n:-1:1 > for j=1:(2*i-1 ) > s(j) = s(j)*edx; > C(j) = max(disc*(pu*C(j)+pm*C(j+1)+pd*C(j+2)),K-s(j)); > end > end dpu = disc * pu; dpm = disc * pm; dpd = disc * pd; for i=n:-1:1 s = s .* edx; KminusS = K - s; d = 2*i-1; C(1:d) = max(dpu * C(1:d) + dpm * C(2:d+1) + dpd * C(3:d+2), ... KMinusS(1:d)) end You can save a further multiplication by dividing dpm, dpd, K and the initial s by dpu. Good luck, Jan ...

Problem with double for loop... help!
Hi, &nbsp; I am very stuck, with this problem, i suppose is stupid problem, but i cant see it.. &nbsp; I attached the vi. My problem is when I use the double for loop to looking for the values of source array between 2 elements from another array, when the vi 'search 1d array', when the values is out of range, put 0 on the rest of array elements, and i would like remove all the 0, i want the double for loop, show only the index from the values between these elements. I know each time the for loop search the range, and when it doesn't find any value put 0, but i dont know do thats!! Any help? &nbsp; Regards Fonsi. &nbsp; &nbsp;Mensaje editado por Fonsi example.vi: http://forums.ni.com/attachments/ni/170/145004/1/example.vi Sorry if I mis-interpreted your request.&nbsp; I cleaned up the front part some by replacing the two unneeded formula nodes with plain old arithmetic functions and also, if I understood you right, fixed the back end.&nbsp; All I really did was change the build array to remove the zeros and bundle them into a cluster so each&nbsp;can have variable lengths. &nbsp; If this is not what you wanted please let us know so we can make further modifications... &nbsp; example[2].vi: http://forums.ni.com/attachments/ni/170/145008/1/example[2].vi Hi Chaos, Thanks for the fast reply.... Well, it solves it, but i need 2D array of index of elements, and putting the bundle, i got 1d array of cluster, any way to maint...

double-double output
Chums, Here is a word that outputs a double-double. The precision is fixed, i.e. 30 significant figures. Anyone who wants to tinker is most welcome. The algorithm is exceedingly naive, however speed is not of the essence. Just a caution to keep others' feet from the pitfall that wasted my afternoon: a double-double numbber may be positive, but the low- order half may be negative. Hence when you take the absolute value you must do this: : ddnegate ( f: x xx -- -x -xx) FNEGATE FSWAP FNEGATE FSWAP ; : ddabs ( f: x xx -- |x+xx|) FOVER F0< IF ddnegate THEN ; Also I found a mistake in dd^n . Here is the correct version: : dd^2 dddup dd* ; : dd^n ( n -- ) ( f: x xx -- [x+xx]^n ) \ raise dd to integer power \ return 1 if n=0, dd^{-|n|} if n<0 dd=1 ddswap ( f: 1e0 0e0 x xx ) DUP 0= IF dddrop drop EXIT THEN DUP 0< SWAP ABS ( -- sign |n| ) BEGIN DUP 0> WHILE DUP 1 AND IF ddtuck dd* ddswap THEN dd^2 2/ REPEAT dddrop DROP IF dd=1 ddswap dd/ THEN ; Here is the word ddfs. in its (factored) glory: 10e0 0e0 ddconstant dd10 : ddabs ( f: x xx -- |x+xx|) FOVER F0< IF ddnegate THEN ; : getSign ( f: x xx -- x xx) ( -- f) FOVER F0< ; : getPower ( f: x xx -- x xx) ( -- n) FOVER FABS FLOG FDUP F0< IF 1e0 F- F>S ELSE F>S THEN ; : normalize ( f: x xx -- |y ...

Sys prefs loop query
With OS 10.4.11 and Mac G4, when I select system prefs, network, I get a looping dialog "Network preferences have been changed by another application". I click OK, but the same dialog drops down again, again and again... Have restarted and shutdown many times. I force sys prefs to quit with cmd opt. esc. The loop comes back next launch. I have trashed syst prefs plist. No change. Have run fsck. Still it keeps coming. Any ideas welcome. In article <49124b89\$0\$22612\$5a62ac22@per-qv1-newsreader-01.iinet.net.au>, Graley <OMIT.highrise@ozemail.com.au> wrote: > With OS 10.4.11 and Mac G4, when I select system prefs, network, I get > a looping dialog "Network preferences have been changed by another > application". > > I click OK, but the same dialog drops down again, again and again... > > Have restarted and shutdown many times. > > I force sys prefs to quit with cmd opt. esc. The loop comes back next launch. > > I have trashed syst prefs plist. No change. > > Have run fsck. Still it keeps coming. > > Any ideas welcome. This is a great chance to use this amazing tool called an Internet browser. There's this web site that categorizes all the other web sites on the entire Internet and it allows you to search that list. Try searching for "looping network preferences Mac OS X" and you'll get a lot of good places to start. You can even search news groups from thi...

nested loops only loop once
I am using two while loops that are nested. The first loop (post name) returns the full column of results, but the second (post modified) only returns the first row of the column. Is there another way I could write this to get both loops to complete fully? I am using the two while loops to pull data from different tables, and insert that data into a list that has html code surrounding each loop. while (\$url = mysql_fetch_array(\$urls, MYSQL_ASSOC)) { \$pn = \$url['post_name']; while (\$date = mysql_fetch_array(\$lmdate, MYSQL_ASSOC)) { \$lm = \$date['post_modified']; echo "<b>"; echo \$pn; echo "</b>"; echo "more html"; echo date('Y-m-d', strtotime(\$lm)); echo "and more html"; } } Thank you. HG toddlahman@gmail.com wrote: > I am using two while loops that are nested. The first loop (post name) > returns the full column of results, but the second (post modified) > only returns the first row of the column. Is there another way I could > write this to get both loops to complete fully? > > I am using the two while loops to pull data from different tables, and > insert that data into a list that has html code surrounding each loop. > > while (\$url = mysql_fetch_array(\$urls, MYSQL_ASSOC)) { > \$pn = \$url['post_name']; > > while (\$date = mysql_fetch_array(\$lmdate, MYSQL_ASSOC)) { > \$lm = \$date['post_modified'...

Web resources about - double loops - comp.soft-sys.matlab

Double-slit experiment - Wikipedia, the free encyclopedia
The double-slit experiment, sometimes called Young's experiment (after Young's interference experiment ), is a demonstration that matter and ...

Don’t bet yet on a double-dissolution election
Keep a close watch on the self interest of the crossbench senators.

Ryanair fail: Double amputee Matthew Parkes asked to crawl onto plane
A BUDGET airline is in damage control after allegedly telling a man who had both legs amputated to drag himself down two ramps, across the tarmac ...

Portland double murder accused Robert Penny dies before day in court
The man charged with cold case murders of two women in a Portland hair salon has died before the court case against him could be completed.

'Drastic' Antarctic melt could double global sea-level rise
BBC News 'Drastic' Antarctic melt could double global sea-level rise BBC News Global sea levels could rise by more than double the current ...

Police: Pilot's blood-alcohol level was double legal limit
Police: Pilot's blood-alcohol level was double legal limit

2015 Renewable Energy Investments Were Double Fossil Fuel Power Plant Investments
... New Energy Finance, and the Frankfurt School. The rapidly rising investment figures are [&hellip 2015 Renewable Energy Investments Were Double ...

Microsoft doubles down on Cortana
At the Build developers conference, Microsoft had a lot to say about its voice assistant. Plus, Windows 10 is on 270 million devices, HoloLens ...

Trump Doubles Down on NATO Criticism: ‘It … Doesn’t Cover Terrorism, Okay?’
Flags flutter in the wind in front of NATO headquarters in Brussels.

Trump Doubles Down On Cruz's Wife: 'There Are Things About Heidi' That People Should 'Look Up'
Republican presidential candidate Donald J. Trump on Sunday insisted that he had no connection to a National Enquirer report suggesting that ...

Resources last updated: 3/31/2016 2:55:00 AM