Re: maple programming

From: John O'Flaherty (quiasmox_at_yahoo.com)
Date: 12/12/04


Date: Sun, 12 Dec 2004 12:09:30 -0600

kelly hamer wrote:
>>help some1 about arrays need to print a second array called c
>>
>
> restart:A:=array(1..4,1..4,[[10,12,10,2],[12,25,27,3],[8,23,17,4],[6,15,6,2]]);
>
>
>>C:=array(1..4,1..4);
>
>
>>for i do 1 to 4
>
>
>> for j do 1 to 4
>
>
>> if A[i,j] < 15 then
>
>
>> A[i,j] = 15
>
>
>>print C = A[i,j]
>
>
>>end do;
>
>
> [10 12 10 2]
>
> [12 25 27 3]
>
> A := [ 8 23 17 4]
>
> [ 6 15 6 2]
>
> i need to print out that every number in the array that is less than
> 15 will be printed out as 15 in a second array called C

I don't use maple, but from the logic of it, it should probably go,
  within the loop:
   C[i,j] = A[i,j]
   if C[i,j] < 15 then
      C[i,j] = 15

then outside the loop:

print C

--
john


Relevant Pages

  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Kevin Backmann ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • RE: Error 3021
    ... Create proto-file names using the selected job names and storre to an array ... Save and close the document and repeat the loop ... Dim strJobsAs String, strDocsAs String, varValsAs _ ...
    (microsoft.public.access.modulesdaovba)
  • Re: Displaying a large amount of data quickly (VB6)
    ... >>> involving a loop of VB code would be too slow. ... but I'd sure be interested to know if that StringBuilder ... Array elements: 25000 ... Array construction: 17 ...
    (microsoft.public.vb.controls)
  • Re: Problem with a script
    ... a loop there becomes impractical. ... You still have them as uniquely named array indexes... ... writing the code twice will only ... reading your entire code and parsing it in their head, ...
    (comp.lang.php)