How to replace multiple cells in an array with DIFFERENT random numbers
显示 更早的评论
I'm attempting to replace values above a certain threshold in array with different random numbers. My code currently replaces all of these values above the threshold with the same random number. I can do this really easily in Excel, but can't seem to find the right code in matlab. I know a loop is probably the best approach, but none of my attempts have worked yet.
Here's an example of my current code
muo_t2 = mean(ERDC128Bx_obliq);
stdo_t2 = std(ERDC128Bx_obliq)/(mean(ERDC92Bx_obliq) - muo_t2);
obliq_t2 = obliq;
obliq_t2( obliq_t2 > muo_t2 ) = norminv(rand(),muo_t2,stdo_t2);
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!