• SEARCH

    통합검색
세모계
    • Dark Mode
    • GNB Always Open
    • GNB Height Maximize
    • Color
    • Brightness
    • SINCE 2015.01.19.
    • 세모계 세모계
    •   SEARCH
    • 세상의 모든 계산기  
      • 자유(질문) 게시판  
      • 계산기 뉴스/정보  
      • 수학, 과학, 공학 이야기  
      • 세모계 : 공지 게시판  
        • 구글 맞춤검색  
      • 세상의 모든 계산기  
        • 자유(질문) 게시판  
    • TI  
    • CASIO  
    • HP  
    • SHARP  
    • 일반(쌀집) 계산기  
    • 기타계산기  
    • 세모계
    • by ORANGEDAY
  • TI
    • TI nspire
    • [function] part() // nspire 레퍼런스 가이드북에 없는 함수

    • Profile
      • 세상의모든계산기
        *.105.205.197
      • 2024.06.22 - 12:21 2024.06.21 - 22:17  197  7

    1. part() 

    "Error: Argument must be a Boolean expression or integer"

     

    1.1 part(data) ⇒ (number) index

    • data 에서 (계산 우선순위상) 처음 실행되는 function(기능) 이 포함하고 있는 요소(argument) 의 갯수를 반환함. 
    • data==list,
      list 의 element 갯수
    • data==matrix,
      matrix 열(row) 갯수
    • data==expression,
      수식에 포함된 기능(연산자(+ - × ÷ ^...) / 함수(cos()...) / "and" / "or" 등등) 중에서, 뭐가 됐든 우선순위가 제일 높은 것에 필요한 요소(argument)의 갯수를 반환함.

     

    1.2 part(data, index) 

    • index==0 일 때, 
      data에 포함된 기능을 string 형식으로 반환합니다. 
      예) "{", "or", "+", "/"
    • data==list,
      list 의 index에 해당하는 요소를 반환
    • data==matrix,
      matrix index에 해당하는 열(row) 를 list 형식으로 반환
    • data==expression,
      기능에 사용되는 요소를 순서대로 반환

     

    2. 사용 예시

     

    06-22-2024 Image003.jpg

    ㄴ 리스트나, 매트릭스는 이해하기 쉽습니다.

     

    06-22-2024 Image004.jpg

    ㄴ 실수나 순허수의 연산자가 없고 자기 자신이 "실수" "순허수"로 기능에 해당합니다. 따라서 요소arguments=0 이 되는 거구요.

    ㄴ 순허수가 아닌 복소수는 실수+순허수와 같이 표현되므로 연산자 "+"가 기능에 해당하고, 실수와 순허수가 요소에 해당하여 arguments=2 가 됩니다.

    ㄴ 유리수는... 조금 특별한데, 1/2 은 기능이 "1/2"로서 argument=0 이고, √2/2 는 기능이 "/" 이고 arguments=2 입니다. 

    ㄴ 수식에 연산자가 있더라도 계산에 의해 즉시 단순화되는 경우(1+2+3 = 6) 단순화된 결과를 기준으로 part() 가 실행됩니다.

     

     

    06-22-2024 Image001.jpg

    ㄴ and 와 or 가 나열되어 있는 경우, or 연산자가 우선순위를 갖습니다. 

    ㄴ or 연산자가 여러개 있을 경우 왼쪽부터 실행됩니다. (and도 동일)

    ㄴ or 연산자는 or 를 기준으로 왼쪽과 오른쪽 두개의 요소로 기능이 구현 됩니다. arguments=2 (and도 동일)

     

    스크린샷 2024-06-22 075141.png

     

    0
    0
    Attached file
    06-22-2024 Image001.jpg 94.0KB 1806-22-2024 Image002.jpg 72.4KB 2406-22-2024 Image001.jpg 94.0KB 2506-22-2024 Image003.jpg 76.5KB 2006-22-2024 Image004.jpg 69.3KB 19스크린샷 2024-06-22 075141.png 37.1KB 23splitor.tns 4.9KB 18
    이 게시물을..
    • 세상의모든계산기 세상의모든계산기 Lv. 25

      계산기는 거들 뿐
      혹은
      계산기를 거들 뿐

    • [프로그램] splitor, sor. "or" 단위로 구분된 수식을 "리스트 / 매트릭스 / 변수 " 형태로 바꿈세상의모든계산기
    • [TI-nspire] 문자(Char), 문자열(String)세상의모든계산기

     댓글 7

      • Profile
      • 세상의모든계산기 (*.105.205.197) 2024.06.21 23:01 #comment_42072

        TI-nspire 레퍼런스 가이드에 없는 것이나, 

        결과물이 일정치 않은 것, 

        등을 보면 

         

        만들다가 만 느낌도 들고... 

        개발자가 혼자 쓰려고 만든 느낌도 들고... 

         

        여튼 있으니까 잘 쓰면 되겠죠.

        럭키비키잖앙~1243575968-66.gif

        0
        댓글
      • FireCraft (*.108.43.236) 2024.06.22 01:25 #comment_42075

        part 명령어에 대한 설명은 ti89 설명서에 나와있습니다.
        이 명령어가 있어야 식을 분해해서 고급 기능을 만드는데,
        이런 중요한 기능을 nspire 매뉴얼에 누락시키고 또 catalog키 눌러서 나오는 목록에도 빼놨습니다.
        어느 하나에만 없었으면 착오로 빠졌겠거니 하는데 둘다 없으니 일부러 빼놓은 게 아닌가 의심됩니다

        0
        댓글
      • Profile
      • 세상의모든계산기 (*.105.205.197) 2024.06.22 01:48 #comment_42094
        TI-89 용 함수였군요.
        으흠...
        0
        댓글
      • FireCraft (*.108.43.236) 2024.06.22 02:02 #comment_42099

        part처럼 연산자나 함수를 뽑아주는 명령어가 그 cas에 없다면 그게 cas라고 부를 수 있나? 생각됩니다.


        전 split( )함수를 구현하면서 (저도 split이란 이름을 붙였습니다) 코드를
        split(v1)=func
        if part(v1,0)="or"
           return augment({part(v1,1)}, {split(part(v2,2))})
        return {v1}
        end func
        이런 방식으로 짰습니다. (이해하기 쉽게 흐름만 보인 것으로 실제 코드는 아닙니다)


        솔직히 아랫글 보고 좀 놀란게 part명령어를 일부러 숨겨놓은 것 같은데 part명령어가 없이 기능들을 짤 수 있을까? 생각해 보았습니다 그러면 식을 string으로 잡아서 거기서 찾아내는 방법을 써야되겠다. 와, 근대 그렇게 짜라고? 이런 생각을 했었는데 제가 생각한 방식 그대로 코드가 되어 있어서였습니다

        0
        댓글
      • FireCraft (*.108.43.236) 2024.06.22 01:34 #comment_42081

        part는 함수,함수의 인수, 그리고 함수의 인수의 갯수를 뽑아내는 명령어입니다.

        함수는 다른말로 연산자라고 할 수 있고요

        ex:=a or b or c라고 하면

        or()라는 함수가 있다고 가정하면

        이해하기 쉽게 ex=or(a, b or c) 형태로 저장이 됩니다

        part(ex,0)="or"

        part(ex.1)=a

        part(ex,2)=b or c

        part(ex)=2 (두개)

         

        0
        댓글
      • Profile
      • 세상의모든계산기 (*.105.205.197) 2024.06.22 02:53 #comment_42124

        [TI-89, 92 plus guidebook] p.477 에 멀쩡하게 나와 있네요.

        제가 nspire part() 로만 검색해서 도통 안나왔었나봅니다. 

         


        part() CATALOG

        part(expression1[,nonNegativeInteger])

        This advanced programming function lets you identify and extract all of the subexpressions in the simplified result of expression1.

        For example, if expression1 simplifies to cos(π* x+3):

        • The cos() function has one argument: (π* x+3).

        • The sum of (π* x+3) has two operands: π* x and 3.

        • The number 3 has no arguments or operands.

        • The product π* x has two operands: p and x.

        • The variable x and the symbolic constant p have no arguments or operands.

        If x has a numeric value and you press diamond enter, the numeric value of π* x is calculated, the result is added to 3, and then the cosine is calculated.

        cos() is the top-level operator because it is applied last.


        part(expression1) ⇒ number

        Simplifies expression1 and returns the number of top-level arguments or operands. This returns 0 if expression1 is a number, variable, or symbolic constant such as π, e, i, or ∞.

        스크린샷 2024-06-22 121602.png

        part(expression1, 0) ⇒ string

        Simplifies expression1 and returns a string that contains the top-level function name or operator. This returns string(expression1) if expression1 is a number, variable, or symbolic constant such as π, e, i, or ∞.

        스크린샷 2024-06-22 121608.png

        part(expression1, n) ⇒ expression

        Simplifies expression1 and returns the nth argument or operand, where n is > 0 and ≤ the number of top-level arguments or operands returned by part(expression1). Otherwise, an error is returned.

        스크린샷 2024-06-22 121616.png

         


         

        By combining the variations of part(), you can extract all of the sub-expressions in the simplified result of expression1. As shown in the example to the right, you can store an argument or operand and then use part() to extract further sub-expressions.

         

        Note: When using part(), do not rely on any particular order in sums and products.

         

        Expressions such as (x+y+z) and (x-y-z) are represented internally as (x+y)+z and (x-y)-z. This affects the values returned for the first and second argument. There are technical reasons why part(x+y+z,1) returns y+x instead of x+y.

         

        Similarly, x*y*z is represented internally as (x*y)*z. Again, there are technical reasons why the first argument is returned as y•x instead of x•y.

         

        When you extract sub-expressions from a matrix, remember that matrices are stored as lists of lists, as illustrated in the example to the right.

         

        스크린샷 2024-06-22 120841.png

         

        The example Program Editor function to the right uses getType() and part() to partially implement symbolic differentiation. Studying and completing this function can help teach you how to differentiate manually. You could even include functions that the TI-89 / TI-92 Plus cannot differentiate, such as Bessel functions.

        스크린샷 2024-06-22 120942.png

        Attached file
        8992bookeng.pdf 6.07MB / 8 스크린샷 2024-06-22 120841.png 233.2KB / 14 스크린샷 2024-06-22 120942.png 109.9KB / 17 스크린샷 2024-06-22 121602.png 17.7KB / 14 스크린샷 2024-06-22 121608.png 8.2KB / 10 스크린샷 2024-06-22 121616.png 23.0KB / 14
        0
        댓글
      • FireCraft (*.108.43.236) 2024.06.22 03:10 #comment_42131

        Ti89매뉴얼에 두페이지 분량으로 실려있는 설명이 nspire에 빠졌다?
        게다가 계산기 안에 카탈로그에도 안보인다?
        이건 일부러 뺀 거 아닌가라고 충분히 의심하게 되죠

        저는 Ti 회사, 좋게 안봅니다

        0
        댓글
    • 댓글 입력
    • 에디터 전환
    댓글 쓰기 에디터 사용하기 닫기
    • 목록 목록
    • [프로그램] splitor, sor. "or" 단위로 구분된 수식을 "리스트 / 매트릭스 / 변수 " 형태로 바꿈
    • [TI-nspire] 문자(Char), 문자열(String)
    • 목록
    7
    by OrangeDay
    • TI
    • allcalc.org
    • 세모계 all rights reserved.