Borrar filtros
Borrar filtros

How do I isolate a specific column within a vector

1 visualización (últimos 30 días)
Laura T
Laura T el 8 de Dic. de 2021
Comentada: Laura T el 8 de Dic. de 2021
Hi Guys,
How do i isolate a specific column within a vector? Like, how do i extract the 4th column only from a 5x5 matrix? What do i code to specifcally get the 4th column values to be presented as a new vector?
TIA

Respuesta aceptada

Atsushi Ueno
Atsushi Ueno el 8 de Dic. de 2021
x = rand(5,5)
x = 5×5
0.0113 0.4122 0.7657 0.0161 0.4709 0.3690 0.4130 0.6656 0.8250 0.0153 0.4433 0.3748 0.1919 0.4600 0.6638 0.7265 0.4383 0.4087 0.0044 0.5566 0.3118 0.2547 0.2757 0.9528 0.7364
y = x(:,4) % extract the 4th column only from a 5x5 matrix
y = 5×1
0.0161 0.8250 0.4600 0.0044 0.9528

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by