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

3 次查看(过去 30 天)
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 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by