- TI nspire
[TI-nspire] 행렬의 입력 & 계산 - 확장 라이브러리 Matrix Library
1. 라이브러리 설명
행렬의 입력 및 계산을 도와주는 확장 라이브러리입니다.
Matrix pieces Arithmetic function & Cofactor Expansion Program TI-Nspire
By creeras
Ver 1.5 (2024-10-21)
---
Usage
Function_name(matrix1,matrix2,row_number,column_number)
: For overwrite(), add(), subtract(), multiply(), divide()
Dim(matrix1) have to be bigger than dim(matrix2), and have to put all matrix2 elements opon matrix1 elements to calculate it.
Function_name(matrix,row_number,column_number)
: For insert(), insertrow(), insertcol(), minor(), cofactor()
Function_name(matrix,r or c,index)
: For coex()
Function_name(matrix)
: For adjoint(), rank(), lunp()
Caution
Result of Function() is not stored to original matrix. So store it to original matrix variable or new matrix variable.
2. 함수 (및 프로그램) 설명
- add(matrix1,matrix2,row_number,column_number) : 행렬을 일부분만 더함
ㄴ mat_big 행렬에 mat_small을 더함. 4행 2열 ~ 5행 3열 부분만
subtract(matrix1,matrix2,row_number,column_number) : 행렬을 일부분만 뺌
multiply(matrix1,matrix2,row_number,column_number) : 행렬을 일부분만 곱함
divide(matrix1,matrix2,row_number,column_number) : 행렬을 일부분만 나눔 - overwrite(matrix1,matrix2,row_number,column_number) : 행렬을 일부분만 덮어쓰기 ; 기존 값은 무시되고, 새로운 함수의 값이 덧쓰입니다.
- insert(matrix,row_number,column_number) : 행 또는 열을 추가합니다. (0으로 채워져 있음)
delete(matrix,row_number,column_number) : 행 또는 열을 삭제합니다(=소행렬)
- Insertrow(matrix,row_number,column_number) : 1행(만)의 이동.
ㄴ 나머지 행들간의 순서변화 없음.
ㄴ 내장함수 rowSwap( )은 2행 사이의 위치 교환
Insertcol(matrix,row_number,column_number) : 1열(만)의 이동. (나머지 열들간의 순서변화 없음.)
- minor(matrix,row_number,column_number) : "소행렬식", 부호를 고려하지 않은 소행렬의 행렬식. \( M_{ij} \)
cofactor(matrix,row_number,column_number) : 여인자, 부호를 고려한 소행렬식. \( C_{ij} = (-1)^{i+j} M_{ij} \)
adjoint() : 딸림행렬 = 수반행렬 - lunp() : permutation 없이 LU 분해하는 프로그램. // v1.4에서 추가됨. (다른 것들은 다 함수인데, 이것은 프로그램입니다)
https://allcalc.org/9593#comment_49292 - coex(matrix,r or c,index) : 여인자 전개 // v1.5 에서 수정됨.
3. 사용 방법
3-1. 라이브러리를 다운로드 : matrix.tns
3-2. TI-nspire의 MyLib 폴더에 옮겨 넣고
3-3. refresh Library : 【Doc】 【6】 상세 설명은 다음 링크 확인 https://allcalc.org/35636
사용하시면 됩니다.
4. 동영상 설명
5. 업데이트 내역
V1.31 (2015-11-22)
근사(approx)계산시 rank 오류 해결
V1.40 (2024-10-07)
lunp() 추가 // permutation 없이 LU 분해함.
V1.50 (2024-10-21)
coex() 수정 // 기존에 열선택할 수 없던 문제, 그리고 step-by-step 확인하지 못하던 문제 해결
댓글12
- 1
- 1
- 2
- 1
- 1
- 2
-
세상의모든계산기
여인자 전개 프로그램 수정 V1.5
Define LibPub coex(mat1,choice,index)= Func :© coex(matrix,r or c,index) :© Initialize :Local mat1_dim,i,j,co.result,minormat,sgn :dim(mat1)→mat1_dim :newMat(mat1_dim[1],2)→co.result : :©Main Body :Disp "Cofactor Expansion =" : :If string(choice)="r" Then : If 1≤index≤mat1_dim[1] Then : For j,1,mat1_dim[2] :[mat1[index,j],cofactor(mat1,index,j)]→co.result[j] : minormat:=delete(mat1,index,j) : sgn:=(−1)^(index+j) : If j=1 Then : If sgn=1 Then : Disp string(mat1[index,j])&"×det(",minormat,")" : Disp "(("&string(mat1[index,j])&")×("&string(minor(mat1,index,j))&"))" : Else : Disp "-("&string(mat1[index,j])&")×det(",minormat,")" : Disp "-"&"(("&string(mat1[index,j])&")×("&string(minor(mat1,index,j))&"))" : EndIf : Else : Disp "----------" : If sgn=1 Then : Disp "+("&string(mat1[index,j])&")×det(",minormat,")" : Disp "+"&"(("&string(mat1[index,j])&")×("&string(minor(mat1,index,j))&"))" : Else : Disp "-("&string(mat1[index,j])&")×det(",minormat,")" : Disp "-"&"(("&string(mat1[index,j])&")×("&string(minor(mat1,index,j))&"))" : EndIf : EndIf : EndFor : Else : Disp "Invalid Row Index" : EndIf : :ElseIf string(choice)="c" Then : If 1≤index≤mat1_dim[2] Then : For i,1,mat1_dim[1] :[mat1[i,index],cofactor(mat1,i,index)]→co.result[i] : minormat:=delete(mat1,i,index) : sgn:=(−1)^(index+i) : : If i=1 Then : If sgn=1 Then : Disp string(mat1[index,i])&"×det(",minormat,")" : Disp "(("&string(mat1[i,index])&")×("&string(minor(mat1,i,index))&"))" : Else : Disp "-("&string(mat1[index,i])&")×det(",minormat,")" : Disp "-"&"(("&string(mat1[index,i])&")×("&string(minor(mat1,index,i))&"))" : EndIf : : Else : Disp "----------" : If sgn=1 Then : Disp "+("&string(mat1[index,i])&")×det(",minormat,")" : Disp "+"&"(("&string(mat1[index,i])&")×("&string(minor(mat1,index,i))&"))" : Else : Disp "-("&string(mat1[index,i])&")×det(",minormat,")" : Disp "-"&"(("&string(mat1[index,i])&")×("&string(minor(mat1,index,i))&"))" : EndIf : : EndIf : EndFor : Else : Disp "Invalid Column Index" : EndIf :Else : Disp "Invalid Choice : Input ""r"" or ""c"" for 2nd argument" :EndIf : :© Finalize :Return det(mat1) :EndFunc
사용 예시
세상의모든계산기 님의 최근 댓글
낮에 TV에서 영화 '말모이' 해주더라구요. 그래서 한번 물어 봤습니다. 2025 10.10 마지막 발언이 마지막 힌트이자 문제의 핵심이군요. 처음 들은 달이 8월이었다면 (15일인지 17일인지 확신할 수 없어서) 마지막 대사를 할 수 없지만, 처음 들은 달이 7월이었다면 (선택지가 16일 하나라서 확신이 가능하므로) 마지막 대사를 할 수 있다. 대사를 했으니 7월이다. 이제 이해되었습니다. 지금 보니까 이해가 되는데, 당시에는 왜 이해가 안됐을까요? 세가지 전제 하에 문제를 풀면 A는 마지막 대화 2줄만으로 C의 생일을 알 수 없어야 정상인데, 무슨 이유에서인지 "그럼 나도 앎!"이라고 선언해 버립니다. 알게 된 이유를 대화 속에서 찾을 수는 없습니다. 이 편견에 사로잡혀 빠져나오지 못하고 다른 길로 계속 샜나봅니다. 2025 10.09 (장*훈)님 (+10,000원) 계좌 후원(2025/10/09) 감사 드립니다. 2025 10.09 원래 식이 풀어진 상태에서는 두번째 인수 v가 분모, 분자에 섞여 있어서 계산기가 처리하지 못하는 듯 합니다. 이 때는 위에서와 반대로 분모 부분만 다른 문자(w)로 치환한 다음 completesquare(,v^2) 처리를 하면 일부분은 묶이는 듯 합니다. 하지만 여기서 처음 모양으로 더 이상 진행되진 않네요. 2025 10.08 전체 식에서 일부분(분모, 루트 내부)만 적용할 수는 없습니다. 번거롭더라도 해당 부분만 따로 끄집어 내서 적용하셔야 합니다. https://allcalc.org/30694#comment_30704 2025 10.08