Create largest N digit number

I need to create an N digit number given only that it is N digits long.
For N = 2, this number would be two nines, or 99, for N = 3 the number would be 999, etc
Anyone know how to code this?

댓글 수: 1

Geoff Hayes
Geoff Hayes 2016년 12월 8일
편집: Geoff Hayes 2016년 12월 8일
DJ - what have you tried so far? Please make an attempt at solving your homework questions before posting them on this forum.

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

답변 (1개)

Chaya N
Chaya N 2016년 12월 8일
편집: Chaya N 2016년 12월 8일

0 개 추천

Try this
(10^N) - 1

댓글 수: 1

Jan
Jan 2016년 12월 8일
Please let the OP solve his homework by his own. If the solutions are posted, they cannot provided without cheating anymore.

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

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

질문:

2016년 12월 8일

댓글:

Jan
2016년 12월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by