3D Scatter with different Z axis vector length

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 件のコメント

Haris Hameed
Haris Hameed 2020 年 10 月 6 日
i want somthing like this
Adam Danz
Adam Danz 2020 年 10 月 6 日
How should 6 values of R be mapped onto 100 values of x and y?
You probably just need to use repelem or repmat but it's unclear how the R values should be assigned.
Haris Hameed
Haris Hameed 2020 年 10 月 6 日
can we somehow plot the x y scatter in layers ??
Adam Danz
Adam Danz 2020 年 10 月 6 日
Sure, but what defines the layers?
I know what x is. I don't know what z should be and I don't know what you want to do with R.
Haris Hameed
Haris Hameed 2020 年 10 月 7 日
X and Y are random numbers. These are actually sample points. And R is the value at which these samples calculated. Advancing R we get set of X and Y data points. So R is the layer number where i want to plot X and Y.
Adam Danz
Adam Danz 2020 年 10 月 7 日
"R is the value at which these samples calculated"
That's where my understanding falls off a cliff. How are 100 random numbers calculated from 6 R values?
If you want a 3D plot, each (x,y) value needs a z value and it's unclear what those z values should be. We need 100 of them.
How should the 100 (x,y) values be distributed across 6 layers?
Haris Hameed
Haris Hameed 2020 年 10 月 7 日
For example R is the section position on a wing surface (y/b). And at each section we get the values of cp, x, y, temp etc.
Adam Danz
Adam Danz 2020 年 10 月 7 日
How do I know what section x(5,:) comes from, for example? What about x(92,:) - what section/level/R is that from?
Haris Hameed
Haris Hameed 2020 年 10 月 7 日
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 2020 年 10 月 7 日
ah.... there we go. Check back in a bit.

サインインしてコメントする。

 採用された回答

Adam Danz
Adam Danz 2020 年 10 月 7 日

0 投票

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 件のコメント

Haris Hameed
Haris Hameed 2020 年 10 月 7 日
Yes exactly, thank you... really appreciate

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by