round, randn
2 次查看(过去 30 天)
显示 更早的评论
Hello
Simple query.
Suppose I assign y=randn(4,1), I get a 4X1 matrix with random numbers which have (may be) 3-4 number after the decimal point.
Can you please help, what I should write to get the one number after the decimal point.
y=some round or fix op((randn(4,1)))
Cheers
回答(1 个)
Jan
2012-2-19
At first remove the integer part, see round or rem. Then multiply the result by 10. The remaining steps are not complicated.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!