Making a Function for matrix

2 vues (au cours des 30 derniers jours)
Manosh Chandra Haldar
Manosh Chandra Haldar le 24 Fév 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 commentaire
madhan ravi
madhan ravi le 24 Fév 2020
What’s 11?

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 24 Fév 2020
Modifié(e) : KSSV le 24 Fév 2020
iwant = (max(A,[],2)-min(A,[],2))'

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by