2017-11-12 30 views
0

제목과 마찬가지로 재귀 사용과 관련된 메이플 프로젝트를 진행하고 있습니다.매트릭스를 사용한 메이플의 반복 관계

예 : 우리는라는 × 3 행렬을 우리가 3 × (B)에 의해 곱 후 3 × (C)에 추가하고, 생성 행렬은 새로운 로서 사용되는 가정 B과 같은 작업을 수행합니다. 내가 메이플에서 어떻게 할까?

답변

0

당신은 procedure와 함께 할 수있는 사용의

recurrence := proc(A,b,c,n) 
    ## A is a k x k matrix 
    ## b is a 1 x k vector 
    ## c is a 1 x k vector 
    ## n is the number of iterations 

    local btemp, i; 

    btemp := b; 

    for i to n do 
     btemp := A.btemp+c; 
    end do; 
end proc: 

예 :

A:= <<1,4,7>|<2,5,8>|<3,6,9>>; 
b:=<1/10,1/10,1/10>; 
c:=<-1,2,-2>; 
seq(recurrence(A,b,c,n),n = 1..3); ## Output the recurrence for 1,2 and 3 iterations