How to create function handle with matrix inputs, vector output?

I am trying to create a function:
FCN = @(x) x(1) + x(2);
that will accept matrix inputs and spit out a vector of values.
Ie. if the input is:
in=[1 2; 3 4], FCN(in)
the output should be: [3 7]
Is there any way of doing this? Right now, the function is only returning the sum of the first column.

 채택된 답변

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Parallel Computing Toolbox에 대해 자세히 알아보기

질문:

ejk
2020년 8월 6일

답변:

2020년 8월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by