3D plot

7 visualizaciones (últimos 30 días)
Andre
Andre el 8 de Mayo de 2011
Hey,
so heres my problm. I have multiple files each of which contains 2 different vectors - a and b. I need to compare all the vectors so that whenever the point represented by the intersection of vector a and b is repeated between files I want to increment the value of a third vector by one. I will then use the third vector as the z axis in a plot of a and b. the idea is to create a 3d plot of the density of intersecting points in each file.
example
for i = 1:length(files)
avalues.(files{i}) = (files{i}.a);
bvalues.(files{i}) = (files{i}.b);
end
comparing all the a & b values in the new structure I would like to create a 'density vector' the same length as the a & b vectors that indicates the number of intersecting points between a & b. so if a(1), b(1) = a(2),b(2) the density vector at that point should read 1 and be incremented once for each identical point.
thanks in advance!

Respuestas (1)

Walter Roberson
Walter Roberson el 8 de Mayo de 2011
I am not clear about what your data is. Are the vectors lists of (x,y) or (x,y,z) coordinates? Or is each vector a single multidimensional directional vector? Or are the vectors ordered lists of single-dimensional coordinates ??
When you talk about intersection, are you talking about interpreting each of the vectors as lists of points and looking for points that are the same? Or do you mean that adjacent points in each of the vectors imply an edge and you are looking for crossing edges?
If a(1),b(1) = {say} a(9),b(9) then is that to count?
Are these coordinates integers? If not then what tolerance should be used for the comparison?
Are the vectors the same length in each of the files?
  7 comentarios
Andre
Andre el 9 de Mayo de 2011
in the above case would a_idx be [1 2 3 4 ; 2 3 4 5]??
Walter Roberson
Walter Roberson el 9 de Mayo de 2011
You want a_idx to be the position of each element of "a" within the vector of unique(a) values. This corresponds to the _third_ output of unique() .

Iniciar sesión para comentar.

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by