Any better way to do this? Please provide your comments
************************************************************************************ array1=['L';'V'] array2=['A';'A';'A';'A';'A'] array3='Y' array4=['K';'R']
for M=1:length(array4)
for i=1:length(array1) cnt=1 cnt1=1 for j=1:length(array2)*length(array2)
if cnt > length(array2)
if cnt1 < length(array2)
cnt1=cnt1+1
end
cnt=1
end
fprintf('%s',array1(i))
for k=1:cnt1
fprintf('%s',array2(k))
end
fprintf('%s',array3)
for L=1:cnt
fprintf('%s',array2(L))
end
fprintf('%s\n',array4(M))
if cnt <= length(array2)
cnt=cnt+1
end
end
end
end
************************************************************************
output:-
cnt = 1
cnt1 = 1
LAYAK
cnt = 2
LAYAAK
cnt = 3
LAYAAAK
cnt = 4
LAYAAAAK
cnt = 5
LAYAAAAAK
cnt = 6
cnt1 = 2
cnt = 1
LAAYAK
cnt = 2
LAAYAAK
cnt = 3
LAAYAAAK
cnt = 4
LAAYAAAAK
cnt = 5
LAAYAAAAAK
cnt = 6
cnt1 = 3
.........................
how to hide the 'cnt' and 'cnt1' variable value display in output.
