how to plot in three dimension (3D)

조회 수: 2 (최근 30일)
Ray
Ray 2015년 10월 5일
댓글: Walter Roberson 2015년 10월 5일
Hi, I am trying to do a 3D plot for 18 by 18 matrix containing a first structure "positions" (x,y coordinates), and a second structure containing "power" in db. I have about 20 files with the position and power structures in each file. I took all the positions from each file and put them in one single structure and the power in another structure. However, the positions repeat after 324 rows (18 X18 = 324). when i tried to plot, i got weird plot. Not sure why, but i am thinking when the positions repeat, the graph does not look right. below is the code i used to do the plot.
load('combine.mat');
Pow=positions.offsetdata;
Pos=[]; for i=1:length(power.positions); Poss=power.positions{i,1}; Pos=[Pos;Poss']; end
figure plot3(Pos(:,1),Pos(:,2),Pow)

답변 (1개)

Walter Roberson
Walter Roberson 2015년 10월 5일
You should be considering using cell2mat() instead of looping putting the data together like that.
When you put the data together like that, there would be no breaks between layers.
What is the size() of Pow ?
  댓글 수: 4
Ray
Ray 2015년 10월 5일
The size of Power is 1296
Walter Roberson
Walter Roberson 2015년 10월 5일
Please clarify about whether you have implicit z coordinates or if the power is to be your z coordinate. If the power is to be your z coordinate then are the different files taken at different times and you need to create an animation?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by