How can I make matrix name and value in one matrix
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have several value with individual name for each. How can I bring all of them in one matrix that first column is value and second column is name. I have:
A = 6;
B= 7;
C = 3;
D = 5;
I want:
Z = [6,A;7,B;3,C;5,D];
0 comentarios
Respuestas (1)
James Tursa
el 24 de Jun. de 2015
You could use a cell array for this. E.g.,
Z = {A,'A';B,'B';C,'C';D,'D'};
1 comentario
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!