How to get the max value between two elements of two separate arrays?
19 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Luis Angel Manriquez Ramirez
le 21 Oct 2022
Réponse apportée : Stephen23
le 21 Oct 2022
Hello everyone, thanks for reading
What I'm trying to do is this:
I have these two arrays:
a= [1,3,4,6]
b= [2,2,5,4]
I want to get a new 'c' array with the max values of a comparison between each element of 'a' and 'b'
this -----------> c= [2,3,5,6]
0 commentaires
Réponse acceptée
Plus de réponses (1)
Stephen23
le 21 Oct 2022
The efficient MATLAB approach:
a = [1,3,4,6];
b = [2,2,5,4];
c = max(a,b)
0 commentaires
Voir également
Catégories
En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!