필터 지우기
필터 지우기

Run Code in GUI matlab every setup time given by user

조회 수: 2 (최근 30일)
ahmed obaid
ahmed obaid 2015년 9월 8일
답변: Shashikiran Rajashekar 2015년 9월 8일
I have written code that found the result that i need , after i pushed the button in my GUI , my question is how we can set a timer for example its take the time from my computer and every 2 or 3 hours its rerun that code and find the result , this time must appear in text box and the number of running also if possible appear in other text box , for example
if open my GUI matlab program and running code then i press the autotime push bottom after i set 2 hourse as autotime then after 2 hourse that code must run and the number of running must appear 2 and then 3 till i close my GUI program .. please an suggestion can help me ..
this is my example code which can write the names of content of folder (test) in an excel table , and this content may every 1 or 2 hours are changed or deleted based on user modified then its write the current result.
filename = 'D:\result.xls'; %The name of your xls file
sheet = 'Sheet1';
column = 'B'; % Initialisation of the column range
column_header = strcat(column , '1');
srcFolders = dir('D:\test\*.*');
for folder = 1:length(srcFolders)
path = strcat('D:\test',srcFolders(folder).name);
xlswrite(filename,{srcFolders(folder).name}, sheet, column_header);
column = char(column + 1); %Moving to the next column
end

채택된 답변

Shashikiran Rajashekar
Shashikiran Rajashekar 2015년 9월 8일
you can use "timer" present in matlab it will the execute the attached call back function after the time has elasped http://in.mathworks.com/help/matlab/matlab_prog/use-a-matlab-timer-object.html

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by