大家好我正在检查大循环中的某些情况,在这个大循环中就是这句话:
%Center Dialouge
timers_c = [start_dpc_sh_hi_timer_c, start_dpc_sh_lo_timer_c, start_ffm_sh_act_hi_timer_c,...
start_ffm_sh_act_lo_timer_c, start_hpot_eff_loss_timer_c, start_lfpt_dpsh_timer_c,...
start_pc_sh_time_c, start_post_tl_nl_c, start_pre_tl_nl_c, start_elec_lu_timer_c];
if perf_case_c ~= -1
for k = 1:10
if iscellstr(timers_c(k)) == 1
perf_case_timer_c = timers_c{k};
timer_set_c = 1;
end
end
end
要确定要在对话消息中输出的开始时间和案例类型:
if timer_set_c == 1
pcase_c = msgbox([sprintf('%s'),perf_case_c,sprintf('\nMET:%s\n'),perf_case_timer_c],'PERFORMANCE CASE');
end
我无法获得if语句来确定哪个案例已确定有效。我试图以某种方式使用从-1到字符串的更改,但它不是很有效。
最小的例子是 %假设所有计时器都初始化为零 %假设大小写= = -1(是一个char数组,字符串 timers_c = [timer1,timer2,timer3]
if case ~= -1
for k = 1:3
if iscellstr(timer_c(k)) ==1
case_time = timers(c{k});
time_set_flag = 1
end
end
end
... 然后在循环之外将是上面的msgbox