おみくじコード👇
``` matlab
close all
clear
img = imread('2026_pick.jpg'); % 背景画像
hh = imshow(img);
hh.Parent.Position = [0,0,1,1]; % 余白削除
h = annotation("textbox", [0.75 0.26 0.05 0.05], "String", "大吉", ...
"HorizontalAlignment", "center", ...
"EdgeColor",'none','FontSize',30);
filename = 'omikuji2026.gif'; % ファイル名
Kuji = ["大吉","中吉","大吉","中吉","小吉","末吉","凶"];
for k = 1:30
h.String = Kuji(randperm(length(Kuji),1));
drawnow % 描画更新
frame = getframe(gcf);
tmp = frame2im(frame); % 画像に変更
[A,map] = rgb2ind(tmp,256); % RGB -> インデックス画像
if k == 1 % 新規 gif ファイル作成
imwrite(A,map,filename,'gif','LoopCount',Inf,'DelayTime',0.01);
else % 以降、画像をアペンド
imwrite(A,map,filename,'gif','WriteMode','append','DelayTime',0.01);
end
end
```