Filter löschen
Filter löschen

extracting two specific columns from matrix (Indexing)

2 Ansichten (letzte 30 Tage)
Mark Sc
Mark Sc am 18 Feb. 2021
Beantwortet: Matt J am 18 Feb. 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)]

Akzeptierte Antwort

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

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by