Print condition

clc;clear;close all;

%Pass condition here
str = 'result==0 && prc_dg[0]<prc_dg[1]';

id = ismember(str,' ');
str(id) = [];
ns = regexp(str,'&&','split');
L = length(ns);
shw = 'PrintFormat("';
for m=1:L
    shw = [shw ' %d,'];
end
shw(end) = [];
shw = [shw '",'];
for m=1:L
    shw = [shw ns{m} ','];
end
shw(end) = [];
shw = [shw ');'];
disp(shw);

ความเห็น

โพสต์ยอดนิยมจากบล็อกนี้

การแก้สมการ Differential ด้วย MATLAB

ว่าด้วยเรื่องของ ERROR

การหาค่าเฉลี่ยโดยไม่ต้องเก็บค่า