Main Content

spy

행렬의 희소성 패턴 시각화

  • Visualization of the sparsity pattern of matrix

설명

예제

spy(S)는 행렬 S의 희소성 패턴을 플로팅합니다. 0인 값은 흰색으로 표시되고 0이 아닌 값은 색으로 표시됩니다. 행렬에서 0이 아닌 요소의 개수가 nz = nnz(S)로 플롯에 표시됩니다.

예제

spy(S,LineSpec)은 플롯에 사용할 마커 기호와 색을 LineSpec에 추가로 지정합니다. 예를 들어 spy(A,'r*')은 0이 아닌 값에 빨간색 별표를 사용합니다.

예제

spy(___,MarkerSize)는 위에 열거된 입력 인수 조합 중 하나와 함께 사용할 수 있으며 마커의 크기를 MarkerSize에 지정합니다.

예제

모두 축소

버크민스터 풀러(Buckminster Fuller)의 측지선 돔(Geodesic Dome)의 연결 그래프에 대한 60×60 희소 인접 행렬을 플로팅합니다. 이 행렬은 C60 분자와 축구공을 나타내기도 합니다.

B = bucky;
spy(B)

Figure contains an axes object. The axes object with xlabel nz = 180 contains a line object which displays its values using only markers.

색과 마커를 지정합니다.

spy(B,'ro')

Figure contains an axes object. The axes object with xlabel nz = 180 contains a line object which displays its values using only markers.

마커 크기도 지정합니다.

spy(B,'ro',2)

Figure contains an axes object. The axes object with xlabel nz = 180 contains a line object which displays its values using only markers.

입력 인수

모두 축소

입력 행렬 S는 일반적으로 희소 행렬이지만, 비희소 행렬일 수도 있습니다.

데이터형: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical
복소수 지원 여부:

마커의 크기로, 양의 정수 스칼라로 지정됩니다.

예: spy(A,3)은 크기가 3인 마커를 사용합니다.

마커 기호와 색으로, 기호로 구성된 문자형 벡터나 string형으로 지정됩니다. 기호는 어떤 순서로 지정해도 좋습니다. 두 가지 특성(마커와 색) 중 하나를 지정하지 않아도 됩니다. 예를 들어 색을 생략하고 마커를 지정할 경우 플롯에는 디폴트 색과 지정된 마커가 사용됩니다.

예: 'or'은 빨간색 원 마커를 사용합니다.

마커설명결과로 생성되는 마커
"o"

Sample of circle marker

"+"플러스 기호

Sample of plus sign marker

"*"별표

Sample of asterisk marker

"."

Sample of point marker

"x"십자

Sample of cross marker

"_"가로선

Sample of horizontal line marker

"|"세로선

Sample of vertical line marker

"square"정사각형

Sample of square marker

"diamond"다이아몬드

Sample of diamond marker

"^"위쪽 방향 삼각형

Sample of upward-pointing triangle marker

"v"아래쪽 방향 삼각형

Sample of downward-pointing triangle marker

">"오른쪽 방향 삼각형

Sample of right-pointing triangle marker

"<"왼쪽 방향 삼각형

Sample of left-pointing triangle marker

"pentagram"펜타그램

Sample of pentagram marker

"hexagram"헥사그램

Sample of hexagram marker

색 이름짧은 이름모양
'red''r'

Sample of the color red

'green''g'

Sample of the color green

'blue''b'

Sample of the color blue

'cyan' 'c'

Sample of the color cyan

'magenta''m'

Sample of the color magenta

'yellow''y'

Sample of the color yellow

'black''k'

Sample of the color black

'white''w'

Sample of the color white

  • format +는 다음과 같이 작은 행렬의 0이 아닌 구조를 표시하기 위한 텍스트 기반 대안입니다.

    format +
    eye(4)
    ans =
    
    +   
     +  
      + 
       +

확장 기능

버전 내역

R2006a 이전에 개발됨

모두 확장

참고 항목

| |

도움말 항목