(matlab ) plot two matrices both of (4*36 double) size?

1 view (last 30 days)
I would like to plot two matrices both of (4*36 double) size. The first contains rho and the second contains depths for the 36 locations
well I looked into surf but it reads two arrays and one matrix rather than two matrices and yes I would like to plot them as column graph
here is an example
rho= magic(36);
rho(5:1:end,:)=[];
D= magic(36);
D(5:1:end,:)=[];
D=sort(D);
So right now the matrix rho contains the densities for the 36 location at four different depths. The matrix D contains the four different depths at which the reading at rho is found. The first element in the first matrix corresponds to the first element in the second matrix and so on in the end what I would like to have is the 36 column with the different reading from (rho) plotted against appropriate depth in (D)
I hope I helped make it clearer somehow

Answers (1)

Image Analyst
Image Analyst on 23 Jun 2013
What is "depth"? Do you mean sort(D) instead of sort(depth)? Assuming so, do you just want a scatter plot of D vs. rho?
scatter(rho(:), D(:));
  1 Comment
Ali
Ali on 23 Jun 2013
Thanks for your reply I wanted to sort D so it represent the depth and what I would like to have finally is a bar (columns) plot

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!