Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
52
Task/Loops-Nested/Stata/loops-nested-5.stata
Normal file
52
Task/Loops-Nested/Stata/loops-nested-5.stata
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
function findval1(a,x,i0,j0) {
|
||||
n=rows(a)
|
||||
p=cols(a)
|
||||
for (i=1; i<=n; i++) {
|
||||
for (j=1; j<=p; j++) {
|
||||
if (a[i,j]==x) {
|
||||
i0=i
|
||||
j0=j
|
||||
return(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
return(0)
|
||||
}
|
||||
|
||||
function findval2(a,x,i0,j0) {
|
||||
n=rows(a)
|
||||
p=cols(a)
|
||||
q=0
|
||||
for (i=1; i<=n; i++) {
|
||||
for (j=1; j<=p; j++) {
|
||||
if (a[i,j]==x) {
|
||||
i0=i
|
||||
j0=j
|
||||
q=1
|
||||
goto END
|
||||
}
|
||||
}
|
||||
}
|
||||
END:
|
||||
return(q)
|
||||
}
|
||||
|
||||
function findval3(a,x,i0,j0) {
|
||||
n=rows(a)
|
||||
p=cols(a)
|
||||
q=0
|
||||
for (i=1; i<=n; i++) {
|
||||
for (j=1; j<=p; j++) {
|
||||
if (a[i,j]==x) {
|
||||
i0=i
|
||||
j0=j
|
||||
q=1
|
||||
break
|
||||
}
|
||||
}
|
||||
if (q) {
|
||||
break
|
||||
}
|
||||
}
|
||||
return(q)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue