フィルターのクリア

Cannot type anything in Command Window after run M.file!

8 ビュー (過去 30 日間)
piggy_jes
piggy_jes 2014 年 11 月 17 日
コメント済み: Andreas Goser 2014 年 11 月 17 日
This is my code :
lottery=[1000,500,200,300,0,0,0,0,0,0]
l=length(lottery);
a=zeros(9:10);
for i=1:l
for j=i+1:l
a(i,j-1)=lottery(i)+lottery(j);
end
end
b=a;
count=0;
for m=1:10
for n=1:9
for p=0:1-m
for q=0:1-n
if a(m+p,n)-b(m,n+q)<=500;
count=count+1;
else
count=count+0;
end
end
end
end
end
After press run button on Blank M-file, I cannot type anything in the command window. The symbol ">>" is disappear.
What did I do wrong ?

回答 (3 件)

Roger Wohlwend
Roger Wohlwend 2014 年 11 月 17 日
You did nothing wrong. When Matlab is busy executing some code it does not allow you to type anything in the command window.

Andreas Goser
Andreas Goser 2014 年 11 月 17 日
I wonder if your code runs through. Your example code runs within a couple of milliseconds within my environment. Can you add output for debugging? Like
for m=1:10
m % to Display the Status
and
disp('End')
at the end?

piggy_jes
piggy_jes 2014 年 11 月 17 日
Thank you. I've found the solution.
  1 件のコメント
Andreas Goser
Andreas Goser 2014 年 11 月 17 日
To help other users with that effect, it would be great if you can describe the solution.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by