write a matlab code to compute golomb sequence
조회 수: 4 (최근 30일)
이전 댓글 표시
Is there any function for golomb sequence in matlab?. write the code to display the golomb sequence [the numbers ].
댓글 수: 0
채택된 답변
추가 답변 (2개)
Aamod Garg
2017년 2월 7일
편집: Aamod Garg
2017년 2월 7일
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
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!