How to save data value in new row ?

2 vues (au cours des 30 derniers jours)
Sohail Ahmed
Sohail Ahmed le 16 Nov 2021
Commenté : Sohail Ahmed le 16 Nov 2021
I want to save the following data (1*22 matrix) in (2*11 matrix) . First row should contain values from 1 to 11 (indices) and the second row should contain values from 12 to 22 (indices).......
data = [471 578 518 270 1102 471 512 630 561 293 1165 511 629 559 292 1162 511 509 627 558 292 1159]

Réponse acceptée

Monika Jaskolka
Monika Jaskolka le 16 Nov 2021
Modifié(e) : Monika Jaskolka le 16 Nov 2021
data = [471 578 518 270 1102 471 512 630 561 293 1165 511 629 559 292 1162 511 509 627 558 292 1159];
reshape(data, [11,2])'
ans = 2×11
471 578 518 270 1102 471 512 630 561 293 1165 511 629 559 292 1162 511 509 627 558 292 1159

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by