write a matlab code to compute golomb sequence
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Olumide David Awe
el 11 de Feb. de 2015
Respondida: pallarlamudi bharadwaj
el 9 de Feb. de 2017
Is there any function for golomb sequence in matlab?. write the code to display the golomb sequence [the numbers ].
0 comentarios
Respuesta aceptada
Más respuestas (2)
Aamod Garg
el 7 de Feb. de 2017
Editada: Aamod Garg
el 7 de Feb. de 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 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!