Info
此问题已关闭。 请重新打开它进行编辑或回答。
how to record many lines in the data reads when only one appliance is turned on to off and beside no other appliance is turned on?
1 次查看(过去 30 天)
显示 更早的评论
only one appliance is turned on to off and beside no other appliance is turned on
10 个评论
Walter Roberson
2018-12-5
The question is not clear .Where is the input from? Record to where ?
What does this have to do with MATLAB Compiler or MATLAB Coder?
Mohammad Junayed
2018-12-6
The algorithm recognizes the opening of a single appliance (electrical appliance) and counts the number of data from opening to closing of a single appliance
Walter Roberson
2018-12-6
What is the input? A series of voltage readings perhaps, with the program having to deduce from the voltagess how many appliaces are active?
Jan
2018-12-6
编辑:Jan
2018-12-6
The relation between the question
"only one appliance is turned on to off and beside no other appliance is turned on"
and the code is not clear:
%% ******************************************************************************************************
% º¯ÊýÃû³Æ£ºEventLog
% º¯Êý¹¦ÄÜ£º±£´æʶ±ðʼþ»òÒì³£µ½txtÎı¾EventLog.txtÖÐ
% ÊäÈë²ÎÊý£º sVersion - °æ±¾ÐÅÏ¢
% sCurrentTime - µ±Ç°²âÊÔʱ¼ä
% sTime - ²âÊԼǼÄÚ±£´æµÄʱ¼ä
% sEvent - ·¢ÉúµÄʼþ
% Êä³ö²ÎÊý£ºÎÞ
%% ******************************************************************************************************
function [ ] = EventLog(sFielsName, sVersion, sCurrentTime, sTime, sEvent)
fid = fopen(sFielsName,'a+');
fprintf(fid,'| %s |\t ',sVersion);
fprintf(fid,'| %s |\t ',sCurrentTime);
fprintf(fid,'| %s |\t ',sTime);
fprintf(fid,'| %s \r\n', sEvent); % »»ÐÐ
fclose(fid);
I do not think, that the term "appliance" help to understand, which problem you have.
By the way, you can simplify the code to:
...
fprintf(fid,'| %s |\t ',sVersion, sCurrentTime, sTime);
fprintf(fid,'| %s \r\n', sEvent); % »»ÐÐ
...
Walter Roberson
2018-12-6
are we to assume that event entries will look like
dishwasher on
kitchen light off
refrigerator on
refrigerator off
refrigerator on
bathroom light on
refrigerator off
bathroom light off
dishwasher off
and the task is to count how many records there are between an on and the corresponding off, with no interest in the elapsed time??
Mohammad Junayed
2018-12-7
The question is ;
The algorithm recognizes the opening of a single appliance and counts the number of data from opening to closing of a single appliance
Is to see how many lines the data reads when only one appliance is turned on to off and no other appliance is turned on ..
此问题已关闭。
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)