Effacer les filtres
Effacer les filtres

3D Scatter with different Z axis vector length

6 vues (au cours des 30 derniers jours)
Haris Hameed
Haris Hameed le 6 Oct 2020
Commenté : Haris Hameed le 7 Oct 2020
i have x and y data of size (100,1), and this data is for a specific number
x = lhsdesign(100,2);
R = 1000:1000:6000;
scatter3(x(:,1),x(:,2),R)
now i want to plot this in 3d scatter. please guide.
it is just like for each R there is an 100 size vector of x and y.
  10 commentaires
Haris Hameed
Haris Hameed le 7 Oct 2020
The sample point is stored for each R. X(92,:,5) so this x is for section 5. For each section (layer) we have 100 data points.
Adam Danz
Adam Danz le 7 Oct 2020
ah.... there we go. Check back in a bit.

Connectez-vous pour commenter.

Réponse acceptée

Adam Danz
Adam Danz le 7 Oct 2020
I don't know how you're storing the variables but the demo below should get you started.
It loops through values of R and you'll need to add the part that extracts the x and y values; for now it just uses the same (x,y) values.
x = lhsdesign(100,2);
R = 1000:1000:6000;
figure()
axes()
hold on % important
view(3)
grid on
for i = 1:numel(R)
% get x values
% x = ???
% y = ???
scatter3(x(:,1),x(:,2), repelem(R(i),numel(x(:,1)),1));
end
view([45,5]) % so you can see the layers (try view([90,0]) too)
  1 commentaire
Haris Hameed
Haris Hameed le 7 Oct 2020
Yes exactly, thank you... really appreciate

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Scatter Plots dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by