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
Jan 2012년 2월 19일
Is this a homework question?
Btw. RANDN replies 15 digits.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2012년 2월 19일

0 개 추천

At first remove the integer part, see round or rem. Then multiply the result by 10. The remaining steps are not complicated.

카테고리

도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

질문:

2012년 2월 19일

편집:

2013년 10월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by