# cline

버전 1.0.0.0 (8.38 KB) 작성자:
Draw a colored line in 2D or 3D
다운로드 수: 6.4K
업데이트 날짜: 2007/4/16

라이선스 보기

There are several files on the FEX which deal with the plotting of colored lines, but they all have some drawbacks. I wrote a little file, which extends the scope of the submission by Kun Liu (s. below, hoping to deliver a general purpose file, which should work for most purposes.

SYNTAX
======
h = cline(x, y [, z, cdata])

INPUT
=====
x: vector with x-values
y: vector with y-values
z (opt.): vector with z-values
cdata (opt.): vector with color-data

2 input arguments => cdata = y; z=0
3 input arguments => cdata = z
4 i.a. & z = [] => cdata = y; z=0

OUPUT
=====
h: Handle to line (i.e. patch-object !!!)

Examples
========
t = 2*pi:.1:8*pi;

cline(sqrt(t).*sin(t), sqrt(t).*cos(t));
cline(sqrt(t).*sin(t), sqrt(t).*cos(t), t);
cline(sqrt(t).*sin(t), sqrt(t).*cos(t), t, rand(size(t))); view(3)
cline(sqrt(t).*sin(t), sqrt(t).*cos(t), [], rand(size(t))); view(3)

OK, hope you find this file useful

Sebastian

### 인용 양식

Sebastian Hölz (2024). cline (https://www.mathworks.com/matlabcentral/fileexchange/14677-cline), MATLAB Central File Exchange. 검색됨 .

개발 환경: R14SP2
모든 릴리스와 호환
##### 플랫폼 호환성
Windows macOS Linux
##### 카테고리
Help CenterMATLAB Answers에서 L*a*b* Color Space에 대해 자세히 알아보기

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0