Functions and Global Variables
이전 댓글 표시
This is my code. (Edited)
function B = PBTask4P2b_f(COUNTER)
B = input('TRUCK B: ');
while COUNTER < 1000
B = B + COUNTER;
if COUNTER > 1000
COUNTER = 0;
fprintf('Counter has been reset to 0.\n')
else
fprintf('COUNTER = %f.\n',B);
end
end
end
댓글 수: 4
Yash Shil Balgobin
2021년 4월 3일
편집: Yash Shil Balgobin
2021년 4월 3일
dpb
2021년 4월 3일
The assignment doesn't ask for the user to input data within either task function...
Yash Shil Balgobin
2021년 4월 3일
dpb
2021년 4월 3일
The example usage of your functions in the problem statement shows it being passed as an argument to the two functions, doesn't it?
Your way, there's no need for an argument variable.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Arduino Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
