Write code to print ten columns of every number between 1 to 10

조회 수: 9 (최근 30일)
Amir Tookli
Amir Tookli 2022년 10월 25일
편집: KALYAN ACHARJYA 2022년 10월 25일
Write code to print ten columns of every number between 1 to 10 like this ; ten 1 under each other in one column Ten 2 under each other in one column ... Ten 10 under each other in one column

답변 (1개)

KALYAN ACHARJYA
KALYAN ACHARJYA 2022년 10월 25일
편집: KALYAN ACHARJYA 2022년 10월 25일
Read at MATLAB Docs randi function
%Hint:
data=randi([1,10],[1,10]) %random array-10 columns between 1 to 10
data = 1×10
6 6 8 1 6 4 1 10 1 3
result=repelem(data,[6],[1]) % 6 number of rows or any
result = 6×10
6 6 8 1 6 4 1 10 1 3 6 6 8 1 6 4 1 10 1 3 6 6 8 1 6 4 1 10 1 3 6 6 8 1 6 4 1 10 1 3 6 6 8 1 6 4 1 10 1 3 6 6 8 1 6 4 1 10 1 3

카테고리

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