Map an array yo another one
Afficher commentaires plus anciens
I have an array like: A=[3,5,6,10] and I need to map it to another one like: B=[1,2,3,4] so instead of returning A, I can return B. how can I do this?
Réponses (2)
Andrei Bobrov
le 15 Fév 2018
Modifié(e) : Andrei Bobrov
le 15 Fév 2018
A=[3,5,6,10];
B=[1,2,3,4];
C = randsrc(8,5,B);
ii = discretize(C,B);
out = A(ii);
1 commentaire
Andrei Bobrov
le 15 Fév 2018
fixed!
>> A = [3,5,6,10];
>> B = [1,2,3,4];
>> interp1(A,B,[5,10])
ans =
2 4
Catégories
En savoir plus sur Creating and Concatenating Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!