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

12 vues (au cours des 30 derniers jours)
Amir Tookli
Amir Tookli le 25 Oct 2022
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

Réponses (1)

KALYAN ACHARJYA
KALYAN ACHARJYA le 25 Oct 2022
Modifié(e) : KALYAN ACHARJYA le 25 Oct 2022
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

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by