- 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사용 예시


세상의모든계산기 님의 최근 댓글
참고 : 라플라스 해법 1- 문제풀이의 개요 [출처] 라플라스 해법 1- 문제풀이의 개요|작성자 공학 엔지니어 지망생 https://blog.naver.com/hgengineer/220380176222 2026 01.01 3×3 이상인 행렬의 행렬식 determinant https://allcalc.org/50536 2025 12.30 답에 이상한 숫자 14.2857142857가 들어간 것은 조건식에 소숫점(.) 이 들어가 있기 때문에 발생한 현상이구요. 100÷7 = 14.285714285714285714285714285714 소숫점 없이 분수로 식이 주어졌을 때와 결과적으로는 동일합니다. 2025 12.30 그럼 해가 무한히 많은지 아닌지 어떻게 아느냐? 고등학교 수학 교과과정에 나오는 행렬의 판별식(d, determinant)을 이용하면 알 수 있습니다. ㄴ 고교과정에서는 2x2 행렬만 다루던가요? 연립방정식의 계수들로 행렬을 만들고 그 행렬식(determinant)을 계산하여야 합니다. 행렬식이 d≠0 이면 유일한 해가 존재하고, d=0 이면 해가 없거나 무수히 많습니다. * 정상적인 경우 (`2y + 8z = 115`)의 계수 행렬: 1 | 1 1 0 | 2 | 1 0 -3.5 | 3 | 0 2 8 | 행렬식 값 = 1(0 - (-7)) - 1(8 - 0) = 7 - 8 = -1 (0이 아니므로 유일한 해 존재) * 문제가 된 경우 (`2y + 7z = 100`)의 계수 행렬: 1 | 1 1 0 | 2 | 1 0 -3.5 | 3 | 0 2 7 | 행렬식 값 = 1(0 - (-7)) - 1(7 - 0) = 7 - 7 = 0 (0이므로 유일한 해가 존재하지 않음) 2025 12.30 좀 더 수학적으로 말씀드리면 (AI Gemini 참고) 수학적 핵심 원리: 선형 독립성(Linear Independence) 3원 1차 연립방정식에서 미지수 x, y, z에 대한 단 하나의 해(a unique solution)가 존재하기 위한 필수 조건은 '주어진 세 개의 방정식이 서로 선형 독립(linearly independent) 관계에 있어야 한다'는 것입니다. * 선형 독립 (Linearly Independent): 어떤 방정식도 다른 방정식들의 조합(상수배를 더하거나 빼는 등)으로 만들어질 수 없는 상태입니다. 기하학적으로 이는 3개의 평면(각 방정식은 3D 공간의 평면을 나타냄)이 단 한 개의 점(해)에서 만나는 것을 의미합니다. * 선형 종속 (Linearly Dependent): 하나 이상의 방정식이 다른 방정식들의 조합으로 표현될 수 있는 상태입니다. 이 경우, 새로운 정보를 제공하지 못하는 '잉여' 방정식이 존재하는 것입니다. 기하학적으로 이는 3개의 평면이 하나의 선에서 만나거나(무수히 많은 해), 완전히 겹치거나, 혹은 평행하여 만나지 않는(해가 없음) 상태를 의미합니다. 질문자님의 사례는 '선형 종속'이 되어 무수히 많은 해가 발생하는 경우입니다. 2025 12.30