Drawing open polygonial lines
이전 댓글 표시
Is it possible to same-color lines be not-connected? Like in this picture: http://i51.tinypic.com/2wns3v8.png
Important part of the problem is that it need to be easy to change coordinates of the lines.
something like:
red=[{(1,1),(3,5),(9,2)},{(5,3),(7,4)}] %%two parts
blue=[{(9,1),(4,3),(3,3),(7,1),(7,9)}] %%one part
draw();
set(red, ....) %%here we change red parts
draw();
댓글 수: 1
Fangjun Jiang
2011년 9월 8일
Not clear what you are asking.
답변 (1개)
Walter Roberson
2011년 9월 8일
Yes. Join all of the x values for red with nan where you the want the break to go, and likewise for the y values, and then plot() the line.
Note: {(1,1),(3,5)} means the same thing to MATLAB as {1,1,3,5} does. () is not a vector grouping operator syntax. Also, [{...}] means the same thing as {...} -- an array containing a single cell array is the same thing as the cell array.
The below might work, but I do not have access to my MATLAB to test it:
red(2,:) = [nan,nan];
redx = cell2mat(cellfun(@(V) V(1:2:end), red(:), 'Uniform', 0));
redy = cell2mat(cellfun(@(V) V(2:2:end), red(:), 'Uniform', 0));
plot(redx, redy, 'r');
카테고리
도움말 센터 및 File Exchange에서 Linear Predictive Coding에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!