Matrix Multiplication Mode for Multiple Inputs etc.

조회 수: 2 (최근 30일)
Gulzar Baig
Gulzar Baig 2021년 9월 1일
댓글: Voss 2021년 12월 18일
I want to write a matlab .m function which can accept one-input or 3-inputs. The inputs can be:-
1 Input = [ND(3xMxN... or Mx3xN... or MxNx3...), 2D(Mx3, 3xN)]. ND can be reshaped to [3xNumber] or [Numberx3] which ever is applicable. The outputs can be 1 or 3.
3 Inputs = [ND, 2D or 1D]. The output can be 1 or 3.
Scenarios:
For 1 input: "should I transpose [3xNumber] to [Numberx3] and then perform matrix multiplication OR carry out out matrix multiplication separately i.e. one formula for row-matrix and another one for the column-matrix?
For 3 inputs: "should I perform operations on 3 inputs separately OR transform|permute|reshape them to [3xNumber] or [Numberx3] then perform multiplication and finally transform|permute|reshape to thier original dimensions as separate inputs.
I need Expert Opinion what method should I adopt such that the code complexity and computation cost are the lowest.
  댓글 수: 1
Voss
Voss 2021년 12월 18일
In my Expert Opinion, you should try different things and see what works best.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by