extracting two specific columns from matrix (Indexing)

1 visualización (últimos 30 días)
Mark Sc
Mark Sc el 18 de Feb. de 2021
Respondida: Matt J el 18 de Feb. de 2021
Hi all,
I am trying to extract two columns (1 and 3) from a matrix, but I got an error "Error: Unbalanced or unexpected parenthesis or bracket"
anyone help!!!
clearvars
clc;
xxx=[1 2 3;2 4 5;3 4 5;1 1 1];
x=[(;,1) (:,3)]

Respuesta aceptada

Matt J
Matt J el 18 de Feb. de 2021
x=xxx(:,[1,3])

Más respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by