Removing a column from a Matrix product in one expression
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
In MATLAB I want to achieve the following in one expression,
C = A * B;
C = C(:, 2:end);
Naturally it'd be something like
C = (A * B)(:, 2:end);
However that gives me an invalid expression error. How do I do this properly?
0 Kommentare
Akzeptierte Antwort
David Fletcher
am 20 Apr. 2021
Strange as it may seem, try this
C= A * B(:, 2:end)
Terser is not always better, especially when things start to become confusing and ambiguous
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing 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!