RECURSION FUNCTION IN MATLAB USING ARRAY

2 vues (au cours des 30 derniers jours)
SANJOY MONDAL
SANJOY MONDAL le 10 Fév 2014
i have an array n of size 100 (value of different index is different). after processing got an array of size half(50). i want to use this array as input to get an array of size 25.process will proceed until size of n be 1.for example
n=[1 2 3 4 5 6 7 8 9 ...100]
n1=[1 0 3 4 0 0 0 0 9...99 0]
i want n1 as input to generate array with 25 elements using only non negative elements
  1 commentaire
Azzi Abdelmalek
Azzi Abdelmalek le 10 Fév 2014
You didn't explain the process.

Connectez-vous pour commenter.

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 10 Fév 2014
n=[1 2 3 4 5 6 7 8 9 ...100];
n1=n;
while numel(n1)>1
% do
% n1=
% n=n1
end
  2 commentaires
SANJOY MONDAL
SANJOY MONDAL le 10 Fév 2014
there are 100 nodes.first pairing between neighbor nodes.one is sender other is receiver.after that again we got 50 receiver nodes and other 50 nodes discarded.pairing those 50 nodes using same algo.and get 25 nodes. this process goes on until 1 node remaining.how can i implement this.plz help
Azzi Abdelmalek
Azzi Abdelmalek le 10 Fév 2014
Modifié(e) : Azzi Abdelmalek le 10 Fév 2014
SANJOY, accepting an answer means your problem is solved. Now If you accepted the answer by accident, please make again, your question as clear as possible. You are asking about implementing something we don't know. I gave you above one way to do it in general, just adapt it to your problem. Is something not clear with that?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing 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!

Translated by