필터 지우기
필터 지우기

3D line animation

조회 수: 5 (최근 30일)
Robert Wu
Robert Wu 2017년 12월 17일
댓글: Robert Wu 2017년 12월 18일
I have data displayed in two lines and runs through an animation loop. Instead of displaying each data point as rectangles, is there a way to display them as 3D cubes or rectangular prisms?
function zzzz(lineS,lineW)
iter = [lineS(1,:);lineW(1,:)];
ploting = imagesc(iter);
for i = 1:size(lineS,1)
iter = [lineS(i,:);lineW(i,:)];
ploting.CData = iter;
pause(0.5);
end
Any help is will be appreciated.
Many thanks,
Rob.
  댓글 수: 2
Jan
Jan 2017년 12월 18일
What exactly are "the data points"? Are you sure that imagesc is the wanted method? Without the inputs, we cannot know, what you see or what the coordinates of the cubes should be.
Robert Wu
Robert Wu 2017년 12월 18일
Hi Jan,
Sorry for the confusion. My line inputs (lineS and lineW) are matrices. Each line is 121 m long and the loop runs for 10 cycles. So I guess for this example you can use rand(10,121) for lineS and lineW.
The resulting plot as is displays two lines (each containing 121 rectangles). Instead of rectangles, I would like cubes.
Rob.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2017년 12월 18일
편집: Jan 2017년 12월 18일
I'd start with asking an internet search engine e.g. for "Matlab draw cubes". Then I find:
Does this help already? If not, the search engine will offer more links also.
Nevertheless, the imagesc approach will be 2D and it will to use it to display 3D objects. So maybe the posted code is not useful for your problem.
  댓글 수: 2
Robert Wu
Robert Wu 2017년 12월 18일
Hi Jan,
Thanks for the reply. I tried Draw Cubes in the past; it's a really good function but the problem is that I cannot associate the cube's color with the data-point's value. Indeed imagesc is not appropriate for 3D objects and I have yet to find a helpful function.
Rob.
Jan
Jan 2017년 12월 18일
What is "Draw Cubes"? "I cannot associate the cube's color with the data-point's value" - does this mean, that you want to do this?
Please explain what your inputs are and what you want as output.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Axes Appearance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by