Effacer les filtres
Effacer les filtres

unknown numbers of input

2 vues (au cours des 30 derniers jours)
khoirul hadi
khoirul hadi le 15 Oct 2015
Modifié(e) : Guillaume le 15 Oct 2015
let say i have M X N matrix, and i want to split it based on its number of rows, example below is 3X5 matrix, so how can i get M variables (x,y,z) without knowing the number of M?
Matrix A became arrays :
1 1 1 1 1 x = 1 1 1 1 1
2 2 2 2 2 => y = 2 2 2 2 2
3 3 3 3 3 z = 3 3 3 3 3

Réponses (2)

Thorsten
Thorsten le 15 Oct 2015
Creating dynamically named variables should be avoided. Just use
A(i,:)
to get you desired vectors.
  1 commentaire
Guillaume
Guillaume le 15 Oct 2015
Modifié(e) : Guillaume le 15 Oct 2015
Indeed. Maybe if khoirul explained his use case, we can explain why his question is a bad idea.

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 15 Oct 2015

Catégories

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

Community Treasure Hunt

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

Start Hunting!

Translated by