找回密码
 注册
关于网站域名变更的通知
查看: 305|回复: 2
打印 上一主题 下一主题

关于MCC的问题,为什么使用MCC编译的文件无法使用循环?

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2020-10-20 17:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
本帖最后由 uiabluqp 于 2020-10-20 17:05 编辑
; U- P) [$ Z( W
  z8 H% h7 N) u& u
  • t=timer();
  • t.StartDelay = 0;%延时1秒开始
  • t.ExecutionMode = 'fixedRate';%启用循环执行
  • t.Period = 1;%循环间隔2秒
  • t.TasksToExecute = inf;%循环次数无限
  • t.TimeRFcn = @(~,~)tianshi;
  • start(t);
  • function tianshi
  • clc;
  • K=exist('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\z_kongzhi.csv');
  • if K==2
  • close all;
  • clear;
  • tic;
  • format compact;
  • %% 处理数据
  • gril=csvread('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\sc_s.csv');
  • boy=csvread('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\sc_b.csv');
  • xingbie_s=csvread('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\sc_ybs.csv');
  • xingbie_b=csvread('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\sc_ybb.csv');
  • [sc_ssr,sc_ssc]=size(gril);
  • [sc_bsr,sc_bsc]=size(boy);
  • scs_r=round(sc_ssr/4);
  • sxl_r=sc_ssr-scs_r;
  • bcs_r=round(sc_bsr/4);
  • bxl_r=sc_bsr-bcs_r;
  • xingbie=[xingbie_s;xingbie_b];
  • dataset = [gril;boy];
  • train_set = [dataset(1:sxl_r,: );dataset(sc_ssr+1:sc_ssr+bxl_r,: )];  %%1到3为gril的训练集,7到8为boy的训练集
  • train_set_labels = [xingbie(1:sxl_r);xingbie(sc_ssr+1:sc_ssr+bxl_r)]; %%1到3为gril的训练集样本,7到8为boy的训练样本
  • test_set = [dataset(sxl_r+1:sc_ssr,: );dataset(sc_ssr+bxl_r+1:sc_ssr+sc_bsr,: )];
  • test_set_labels = [xingbie(sxl_r+1:sc_ssr);xingbie(sc_ssr+bxl_r+1:sc_ssr+sc_bsr)];
  • %% 归一化
  • [mtrain,ntrain] = size(train_set);
  • [mtest,ntest] = size(test_set);
  • test_dataset = [train_set;test_set];
  • [dataset_scale,ps] = mapminmax(test_dataset',0,1);
  • dataset_scale = dataset_scale';
  • train_set = dataset_scale(1:mtrain,: );
  • test_set = dataset_scale( (mtrain+1): (mtrain+mtest),: );
  • %% 归一化测试
  • xingbiecheshi=csvread('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\sc_dx.csv');
  • [mtest_1,ntest_1] = size(xingbiecheshi);
  • test_dataset_1 = [xingbiecheshi];
  • [dataset_scale_1,ps] = mapminmax(test_dataset_1',0,1);
  • dataset_scale_1 = dataset_scale_1';
  • test_set_1 = dataset_scale_1( 1:mtest_1,: );
  • bb=[train_set_labels train_set];
  • SPECTF = bb;
  • labels = SPECTF(:, 1); % labels from the 1st column
  • features = SPECTF(:, 2:end);
  • features_sparse = sparse(features); % features must be in a sparse matrix
  • libsvmwrite('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\h.txt', labels, features_sparse);
  • aa=[test_set_labels test_set];
  • SPECTF_1 = aa;
  • labels = SPECTF_1(:, 1); % labels from the 1st column
  • features = SPECTF_1(:, 2:end);
  • features_sparse = sparse(features); % features must be in a sparse matrix
  • libsvmwrite('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\t.txt', labels, features_sparse);
  • cc=[0 test_set_1];
  • SPECTF_3 = cc;
  • labels = SPECTF_3(:, 1); % labels from the 1st column
  • features = SPECTF_3(:, 2:end);
  • features_sparse = sparse(features); % features must be in a sparse matrix
  • libsvmwrite('C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\p.txt', labels, features_sparse);
  • cd 'C:\Program Files (x86)\MetaTrader 4 IC Markets\MQL4\Files\EURJPY\';
  • delete z_kongzhi.csv;
  • end
  • end
      s% A2 m3 n( E8 K, [% K, y
7 i, {- K2 c* Z/ Q
0 [: u+ T$ v! w* I% \, [4 C
5 p7 s9 g, h7 h
将上面的文件使用MCC编译成EXE文件,但是不知道为什么执行一次之后,命令窗口直接关闭了,不会循环这是什么?能否有大神能教教我
( i0 O7 X- C. T+ ~
+ w8 ^% b5 C6 z7 k6 I

该用户从未签到

2#
发表于 2020-10-20 20:12 | 只看该作者
这个程序看的头疼
  • TA的每日心情

    2019-11-29 15:37
  • 签到天数: 1 天

    [LV.1]初来乍到

    3#
    发表于 2020-10-20 20:24 | 只看该作者
    路过,看看你的程序
    您需要登录后才可以回帖 登录 | 注册

    本版积分规则

    关闭

    推荐内容上一条 /1 下一条

    EDA365公众号

    关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

    GMT+8, 2025-6-22 12:03 , Processed in 0.062500 second(s), 23 queries , Gzip On.

    深圳市墨知创新科技有限公司

    地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

    快速回复 返回顶部 返回列表