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 ExchangeTest 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