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


세상의모든계산기 님의 최근 댓글
V2 갱신 (nonK / K-Type 통합형) 예전에는 직접 코드작성 + AI 보조 하여 프로그램 만들었었는데, 갈수록 복잡해져서 손 놓고 있었습니다. 이번에 antigravity 설치하고, 테스트 겸 새로 V2를 올렸습니다. 직접 코드작성하는 일은 전혀 없었고, 바이브 코딩으로 전체 작성했습니다. "잘 했다 / 틀렸다 / 계산기와 다르다." "어떤 방향에서 코드 수정해 봐라." AI가 실물 계산기 각정 버튼의 작동 방식에 대한 정확한 이해는 없는 상태라서, V1을 바탕으로 여러차례 수정해야 했습니다만, 예전과 비교하면 일취월장 했고, 훨씬 쉬워졌습니다. 2026 02.04 A) 1*3*5*7*9 = 계산 945 B) √ 12번 누름 ㄴ 12회 해도 되고, 14회 해도 되는데, 횟수 기억해야 함. ㄴ 횟수가 너무 적으면 오차가 커짐 ㄴ 결과가 1에 매우 가까운 숫자라면 된 겁니다. 1.0016740522338 C) - 1 ÷ 5 + 1 = 1.0003348104468 D) × = 을 (n세트) 반복해 입력 ㄴ 여기서 n세트는, B에서 '루트버튼 누른 횟수' 3.9398949655688 빨간 부분 숫자에 오차 있음. (소숫점 둘째 자리 정도까지만 반올림 해서 답안 작성) 참 값 = 3.9362834270354... 2026 02.04 1. 분모 먼저 계산 400 × 10000 = 100 × 6000 = GT 결과값 4,600,000 역수 처리 ÷÷== 결과값 0.00000021739 2. 분자 곱하기 ×3 00 00 00 ×4 00 ×1 00 00 최종 결과 = 2,608,695.65217 2026 02.04 해결 방법 1. t=-1 을 기준으로 그래프를 2개로 나누어 표현 ㄴ 근데 이것도 tstep을 맞추지 않으면 문제가 발생할 것기도 하고, 상관이 없을 것 같기도 하고... 모르겠네요. 2. t=-1 이 직접 계산되도록 tstep을 적절하게 조정 tstep=0.1 tstep=0.01 도 해 보고 싶지만, 구간 크기에 따라 최소 tstep 이 변하는지 여기서는 0.01로 설정해도 0.015로 바뀌어버립니다. 그래서 tstep=0.02 로 하는게 최대한 긴 그래프를 얻을 수 있습니다. 2026 02.02 불연속 그래프 ti-nspire는 수학자처럼 연속적인 선을 그리는 것이 아니라, 정해진 `tstep` 간격으로 점을 찍고 그 점들을 직선으로 연결하는 'connect-the-dots' 방식으로 그래프를 그립니다. 여기에 tstep 간격에 따라 특이점(분모=0)이 제외되어 문제가 나타난 것입니다. seq(−2+0.13*t,t,0,23) {−2.,−1.87,−1.74,−1.61,−1.48,−1.35,−1.22,−1.09,−0.96,−0.83,−0.7,−0.57,−0.44,−0.31,−0.18,−0.05,0.08,0.21,0.34,0.47,0.6,0.73,0.86,0.99} t=-1 에서 그래프를 찾지 않습니다. 그 좌우 값인 −1.09, −0.96 두 값의 그래프값을 찾고, Window 범위를 보고 적당히 (연속되도록) 이어서 그래프를 완성하는 방식입니다. 그래서 t=-1에서도 그래프 값이 존재하는 것입니다. 2026 02.02