Clear Filters
Clear Filters

how to plot in three dimension (3D)

2 views (last 30 days)
Ray
Ray on 5 Oct 2015
Commented: Walter Roberson on 5 Oct 2015
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)

Answers (1)

Walter Roberson
Walter Roberson on 5 Oct 2015
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 Comments
Ray
Ray on 5 Oct 2015
The size of Power is 1296
Walter Roberson
Walter Roberson on 5 Oct 2015
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?

Sign in to comment.

Categories

Find more on Polar Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!