write a matlab code to compute golomb sequence
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Olumide David Awe
le 11 Fév 2015
Réponse apportée : pallarlamudi bharadwaj
le 9 Fév 2017
Is there any function for golomb sequence in matlab?. write the code to display the golomb sequence [the numbers ].
0 commentaires
Réponse acceptée
Plus de réponses (2)
Aamod Garg
le 7 Fév 2017
Modifié(e) : Aamod Garg
le 7 Fév 2017
function [seq] = golomb(n)
%n is defined by user
a = zeros(1,n);
a(1,1) = 1;
for j = 2:n
a(1,j) = 1+a(1,j-a(1,a(1,j-1)));
seq = a;
end
0 commentaires
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!