How can i get standard deviation in a scatter3 plot

2 ビュー (過去 30 日間)
Rasmus Jessen
Rasmus Jessen 2019 年 5 月 8 日
回答済み: Star Strider 2019 年 5 月 8 日
figure
scatter3(SL0,SR0,V0,15)
hold on
scatter3(SL20,SR20,V20,15)
scatter3(SL30,SR30,V30,15)
plot3(L2,L1,L3,'b')
plot3(LL2,LL1,LL3,'r')
plot3(LLL2,LLL1,LLL3,'k')
hold off
grid on
This is my current code which gives me
matlab_help.png
I would like to get a standard deviation in both x,y,z direction for each of the data points (the 9 dots). I think it's rather advanced, so is it even possible?
  1 件のコメント
KSSV
KSSV 2019 年 5 月 8 日
Read about std

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

回答 (1 件)

Star Strider
Star Strider 2019 年 5 月 8 日
It would be easiest to concatenate your scalar variables into a matrix, then take the standard deviation of the matrix rows:
Smtx = [SL0, SL20, SL30; SR0, SR20, SR30; V0, V20, V30];
Ssd = std(Smtx,[],2)
Here, Ssd(1) is the standard deviation of the x-values, Ssd(2) y-values, and Ssd(3) z-values.
If you only have the three sets of scalar values, this will work. If you have more data, or if your data are different, you need to change the code accordingly.

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by