vector confusion
Mostra commenti meno recenti
I have a vector A whose values are indices for vector P.
Say A = 2 occurs 10 times.
If I do:
P(A) = P(A) + 1
P(2) = 1 % not 10
I believe I understand why this is happening. Is there a solution without going into FOR loops? A could be quite large.
2 Commenti
the cyclist
il 22 Set 2011
I do not understand what you mean by "A = 2 occurs 10 times". Can you write out code for what you mean?
Leor Greenberger
il 22 Set 2011
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements 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!