One-to-one correspondence anonymous function
Mostra commenti meno recenti
I was wondering if can make an injective (one-to-one correspondence) anonymous function to do this;
if the input was one member from P then function convert it to correspondence member in N, for example if input is x=10 out put will be y=5, x=105-->y=4 and ...
P=[10;100;105;700;943]
N=[5;8;4;11;20]
Thanks in advance, Arash
1 Commento
Walter Roberson
il 11 Feb 2013
are your x values always integer? if not there can be a problem.
Risposta accettata
Più risposte (1)
Walter Roberson
il 10 Feb 2013
@(x) N(ismember(x, P))
2 Commenti
Azzi Abdelmalek
il 10 Feb 2013
Maybe it's
ismember(P,x)
Walter Roberson
il 11 Feb 2013
Good point.
Categorie
Scopri di più su Logical in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!