Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

I have the code which generates an array for a1. For N = 10, what does a1 = [a1 a1+N/2] stores.? Is there any need?

1 vue (au cours des 30 derniers jours)
Neha W
Neha W le 21 Sep 2016
Clôturé : MATLAB Answer Bot le 20 Août 2021
if mod(N,2)==0 && mod(N,4)~= 0
a1 = 1: (N/2-1);
a1 = a1(gcd(a1,N/2)==1);
a1 = [a1 a1+N/2];
end

Réponses (1)

Walter Roberson
Walter Roberson le 21 Sep 2016
a1 = [a1 a1+N/2]
is the same as
a1 = horzcat(a1, a1+N/2);
which is to say, append a1+N/2 on the end of the current a1

Cette question est clôturée.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by