creating a for loop with multiple conditions.

Hello,
I have the following data
TEST DATE RESULT_A RESULT_B
in a table format
I'm trying to reformat so that if the test name is the same and date is the same then print a header and tabulate the rest of the results. else create a new header.
here is the code I have but it keeps creating a header for each row.
a= test
b= date
d=RESULT_A
e=RESULT_B
j=1:length(b)
for i = 1:length(a)-1
if strcmp(a{i},a{i+1}) && datenum(b{j,1})== datenum(b{j+1,1})
fprintf('\n\n\n\n%s\t%s \n','TEST' ,a{i})
fprintf('%s\t%s\n','DATEFORMAT','yyyy-mm-dd')
fprintf('%s\t%s\n','DATE',b{i})
fprintf('%s\n','"RESULT_A" "RESULT_B"')
fprintf('%s\t%s\t\n','RESULT_A','RESULT_B')
fprintf('%d\t%d\n',d(i),e(i)
end
end

답변 (0개)

카테고리

도움말 센터File Exchange에서 Test Model Components에 대해 자세히 알아보기

제품

태그

질문:

2016년 5월 11일

편집:

2016년 5월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by