Please Help! I am struggling

1 回表示 (過去 30 日間)
howard jenkins
howard jenkins 2021 年 4 月 15 日
回答済み: Thukiller 2021 年 4 月 15 日
I have been trying to fix this code for 3 hours and I can't could someone please help me fix it?
function RollDicePlot()
fig = uifigure;
ax = uiaxes('Parent',fig,...
'Units','pixels',...
'Position', [104, 123, 300, 201]);
% Create a button
btn = uibutton(fig,'push',...
'Position',[420, 218, 100, 22],...
'ButtonPushedFcn', @(btn,event) diceButton(btn,ax));
end
% Create the function for the ButtonPushedFcn callback
function diceButton(btn,ax)
N1=1; N2=6;
p=randperm(N1:N2);
disp(p)
end

回答 (1 件)

Thukiller
Thukiller 2021 年 4 月 15 日
randperm(N1:N2)——>randperm(N2)
p = randperm(n)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by