How I sum to matrix wich one is the mean of the value and the other the standard deviation?

1 次查看(过去 30 天)
you certainly know that a value in order to be defined correctly it must be defined by its mean plus or minus its standard deviation:
VALUE= MEAN ± STANDARD DEVIATION
Now, I have a matrix for the mean (meanbasket) and a matrix for the standard deviation (devstdbasket).
How can I obtain the matrix of the value?

采纳的回答

Matt J
Matt J 2021-9-30
I this what you mean?
[m,n]=size(meanbasket);
value=meanbasket+randn([m,n]).*devstdbasket;
  2 个评论
HelpAStudent
HelpAStudent 2021-9-30
No, it's not. Because I have the value of both the matrix (I don't want random values): the matrix who's the value are from the standard deviation have also the problem to change size on every loop. So I also should have them preallocating for speed.
Matt J
Matt J 2021-9-30
It's not at all clear what you're trying to calculate. If you're just trying to compute the upper and lower bounds mentioned in your original post, then you obviously know already what operations are required because you yourself posted equations for them.
upperBound=meanbasket+devstdbasket;
lowerBound=meanbasket-devstdbasket;

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by