may i ask how to separate a value into two different values? For example, 12 can be separate into 8 and 4..

조회 수: 1 (최근 30일)
may i ask how to separate a value into two different values? For example, 12 can be separate into 8 and 4..
  댓글 수: 2
Stephen23
Stephen23 2016년 4월 22일
12 can be separated into an infinite number of numbers. What is so special about 8 and 4 ?
loong seow li
loong seow li 2016년 4월 23일
that is just the example that what I want... because I need to split the value into two random numbers... may be 12 can be split into 6 and 6 or 7 or 5...

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

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 4월 22일
편집: Azzi Abdelmalek 2016년 4월 22일
If you mean how to do it randomly with integer numbers:
N=12
a=randi(N)
b=N-a

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by