creating new number from two numbers
조회 수: 1(최근 30일)
Andrew Reibold 2014년 12월 2일
편집: Andrew Reibold 2014년 12월 2일
Judging by your example, I believe you mean b repeated a times. Not a times b.
Yes there is a command for that.
The first number is what is to be repeated. The second number is how many rows to be repeated across. The third number is how many columns to be repeated across.
Edit : This actually doesn't combine them into one number but puts it into a matrix. Combine after repeating? Not sure how to do in one step. Maybe another approach out there. If you don't mind turning the result into a string, combining them, then turning it to a number, that's what I would do.
Guillaume 2014년 12월 2일
Using conversion to string and back this is easy but maybe not fast:
repeat = 3;
number = 12;
repeatednumber = str2num(repmat(num2str(number), 1, repeat))