adding values in array
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi suppose I have two variable
idx1=
1
2
3
idx2=
4
5
I need to have a third variable idx3 where idx3=
1
2
3
4
5
NB. idx1 and idx2 are linear indices and idx3 is the indices having all idx1 and idx2
0 comentarios
Respuesta aceptada
Yoav Livneh
el 8 de Sept. de 2011
If idx1 and idx2 are row vectors you can do
idx3 = [idx1 idx2];
If they are column vectors do
idx3 = [idx1; idx2];
1 comentario
Jan
el 8 de Sept. de 2011
And if you don't know the orientation of the vectors: idx3 = cat(1, idx1(:), idex2(:)).
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrices and Arrays 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!