sprintf
I’m trying to get sprintf to print out a line that says:
‘for event —– stations pass the criteria test=’
where it will list the results for my stations vertically like:
U02B.HHZf
U04B.HHZf
U05B.HHZf
U06B.HHZf
and so on. I can’t seem to get it to do this..it keeps combining my stations together something like UUU00452648BBBB….HHHHHZZZZZfffff. I’m looking at the help pages but there are few examples, any suggestions? This is what I’ve written so far:
u=char(files(keep==1));
str1=sprintf(‘for event %s stations passed criteria
test=%fn’,char(dirs(i)),char(u));
disp(str1)
where u=
U02B.HHZf
U04B.HHZf
U05B.HHZf
U06B.HHZf
and dirs(i) corresponds to my directories. Any suggestions or help in what I’m doing wrong?
KayleI’m trying to get sprintf to print out a line that says:
‘for event —– stations pass the criteria test=’
where it will list the results for my stations vertically like:
U02B.HHZf
U04B.HHZf
U05B.HHZf
U06B.HHZf
and so on. I can’t seem to get it to do this..it keeps combining my stations together something like UUU00452648BBBB….HHHHHZZZZZfffff. I’m looking at the help pages but there are few examples, any suggestions? This is what I’ve written so far:
u=char(files(keep==1));
str1=sprintf(‘for event %s stations passed criteria
test=%fn’,char(dirs(i)),char(u));
disp(str1)
where u=
U02B.HHZf
U04B.HHZf
U05B.HHZf
U06B.HHZf
and dirs(i) corresponds to my directories. Any suggestions or help in what I’m doing wrong?
Kayle I’m trying to get sprintf to print out a line that says:
‘for event —– stations pass the criteria test=’
where it will list the results for my stations vertically like:
U02B.HHZf
U04B.HHZf
U05B.HHZf
U06B.HHZf
and so on. I can’t seem to get it to do this..it keeps combining my stations together something like UUU00452648BBBB….HHHHHZZZZZfffff. I’m looking at the help pages but there are few examples, any suggestions? This is what I’ve written so far:
u=char(files(keep==1));
str1=sprintf(‘for event %s stations passed criteria
test=%fn’,char(dirs(i)),char(u));
disp(str1)
where u=
U02B.HHZf
U04B.HHZf
U05B.HHZf
U06B.HHZf
and dirs(i) corresponds to my directories. Any suggestions or help in what I’m doing wrong?
Kayle sprintf MATLAB Answers — New Questions