필터 지우기
필터 지우기

Removing a column from a Matrix product in one expression

조회 수: 1 (최근 30일)
JC
JC 2021년 4월 20일
댓글: JC 2021년 4월 20일
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?

채택된 답변

David Fletcher
David Fletcher 2021년 4월 20일
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
  댓글 수: 1
JC
JC 2021년 4월 20일
Thanks. Interesting. This is actually a different method but does produce the correct solution.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by