I have examples of scripts that I've made, but I do not know how to change to a script that can be accepted by MATLAB
aa = area;
cc = clock;
waktu = cc;
if aa>500
if waktu = 0 then waktu = cc
save time;
selisih=cc - save time;
if selisih > 180000
alarm
end
end
else
waktu=0
end

댓글 수: 2

Which programming language is that? I do not recognize
take clock just minute
from any of the languages I have encountered.
saiful irfan
saiful irfan 2015년 6월 27일
편집: saiful irfan 2015년 6월 27일
The only explanation
I mean I just wanted to take a minute of the clock (save time)

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2015년 6월 27일

0 개 추천

aa = area;
cc = clock;
waktu = cc;
if aa>500
if isequal(waktu,0)
waktu = cc;
save_time = clock;
selisih = etime(cc,save_time); %result is in seconds
if selisih > 180000
disp('alarm');
end
end
else
waktu = 0;
end
I have no idea what you intended for "area" so I left that alone. "alarm" is pretty vague so I just had it display the string.
There are a number of problems with your logic, but this is the implementation of what you wrote.
Amongst other problems: you asked to take cc minus the time that was just saved. cc was saved earlier so it is going to be a lower time value. A lower time value minus the current time value is going to be negative, and so will never be greater than 180000.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

질문:

2015년 6월 27일

댓글:

2015년 6월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by