Error in a line
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi everybody, I'm creating a new function but I have problems with the following code:
function I= ind(passo, MATRICE, stato, numero_simulazione)
if MATRICE(numero_simulazione, passo)==stato
I=1;
else
I=0;
end
end
Could you help me please? Thank you
댓글 수: 4
Walter Roberson
2013년 6월 21일
Did it tell you that function definitions were not permitted in that context? Did it tell you that array indices must be non-positive integers? Did it tell you that an input argument was not defined?
답변 (1개)
Walter Roberson
2013년 6월 21일
In order to run that function, you must start it from the MATLAB command line, and you must provide all the relevant arguments in that command. For example,
ACAD>> ind(5, floor(10*rand(15,17)), 2, 11)
You cannot start this function by just pressing F5 or clicking "Run" in the menus.
참고 항목
카테고리
Help Center 및 File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!