Borrar filtros
Borrar filtros

extract certain lines in matrice

3 visualizaciones (últimos 30 días)
Dija
Dija el 6 de Mayo de 2015
Comentada: Dija el 6 de Mayo de 2015
hi everyone i have this matrice
0.8979 0.8979 0.8979 0.8979 0.8979 0.8979 0.8979 0.8979
0.5934 -0.5934 0.5934 -0.5934 0.5934 -0.5934 0.5934 -0.5934
0.5934 0.5934 -0.5934 -0.5934 0.5934 0.5934 -0.5934 -0.5934
0.8979 -0.8979 -0.8979 0.8979 0.8979 -0.8979 -0.8979 0.8979
0.5934 0.5934 0.5934 0.5934 -0.5934 -0.5934 -0.5934 -0.5934
0.8979 -0.8979 0.8979 -0.8979 -0.8979 0.8979 -0.8979 0.8979
0.8979 0.8979 -0.8979 -0.8979 -0.8979 -0.8979 0.8979 0.8979
0.5934 -0.5934 -0.5934 0.5934 -0.5934 0.5934 0.5934 -0.5934
I want to extract the line 1&2&4&7 in order to put them in another equation can anyone give me the code to put certain lines in another place

Respuesta aceptada

Guillaume
Guillaume el 6 de Mayo de 2015
This is very basic matrix indexing which is covered in the Getting started tutorial:
m = [0.8979 0.8979 0.8979 0.8979 0.8979 0.8979 0.8979 0.8979
0.5934 -0.5934 0.5934 -0.5934 0.5934 -0.5934 0.5934 -0.5934
0.5934 0.5934 -0.5934 -0.5934 0.5934 0.5934 -0.5934 -0.5934
0.8979 -0.8979 -0.8979 0.8979 0.8979 -0.8979 -0.8979 0.8979
0.5934 0.5934 0.5934 0.5934 -0.5934 -0.5934 -0.5934 -0.5934
0.8979 -0.8979 0.8979 -0.8979 -0.8979 0.8979 -0.8979 0.8979
0.8979 0.8979 -0.8979 -0.8979 -0.8979 -0.8979 0.8979 0.8979
0.5934 -0.5934 -0.5934 0.5934 -0.5934 0.5934 0.5934 -0.5934];
subm = m([1 2 4 7], :); %select all columns of rows 1, 2, 4 and 7

Más respuestas (0)

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!

Translated by