MATLAB Answers

Making a Function for matrix

조회 수: 1(최근 30일)
Manosh Chandra Haldar
Manosh Chandra Haldar 24 Feb 2020
How can I write a function that takes a matrix input argument, calculates the difference bwtween maximum and mimuim valued elements in each row and gives a row vector as its output. see the following example
A = [1:4;5:8;9:12];
[x y] = minimax (A)
x = 3 3 3
y = 11

  댓글 수: 1

madhan ravi
madhan ravi 24 Feb 2020
What’s 11?

로그인 to comment.

답변(1개)

KSSV
KSSV 24 Feb 2020
편집: KSSV 24 Feb 2020
iwant = (max(A,[],2)-min(A,[],2))'

  댓글 수: 1

Manosh Chandra Haldar
Manosh Chandra Haldar 27 Feb 2020
Thanks

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.

태그


Translated by