vec2str.m (347B)
1 function str=vec2str(data); 2 3 % vec2str.m 7/8/04. The reverse of strmat. 4 % 5 % Takes a vector of data and creates a string separated by spaces. 6 % Used for creating the tle to pass to cshow. 7 % 8 % e.g. data=(1950:10:2000)'; vec2str(data)= '1950 1960 1970 1980...' 9 10 str=num2str(data(1)); 11 for i=2:length(data); 12 str=[str ' ' num2str(data(i))]; 13 end;