% [ TensileTest.m ] % % [ ENGN.3110 Engineering Materials Laboratory ] % % [ Written by Tzuyang Yu, SERG, CEE, UML ] % [ 09/03/2016 ] clear all; close all; fsize = 16; fname = 'TensileTest'; %--> Enter the file name you prefer to save. disp('----------------------------------------------'); disp('[ CIVE.3110 Engineering Materials Laboratory ]'); disp('[ Tension Test Data Processing ]'); disp('[ Written by Tzuyang Yu, CEE, UMass Lowell ]'); disp('----------------------------------------------'); load data_TensileTest.txt; %--> This is the data file. Revise the name as necessary. data = data_TensileTest; %--> This line needs to be changed alone with your file name. figure; plot(data(:, 1), data(:, 3)/1000, 'LineWidth', 2); xlabel('Extension (in)', 'fontsize', fsize); ylabel('Load (kipf)', 'fontsize', fsize); ylim([0 16]); xlim([0 0.8]); grid on; set(gca,'YTick',[0, 2, 4, 6, 8, 10, 11, 12, 14, 16],... 'YTickLabel',[0, 2, 4, 6, 8, 10, 11, 12, 14, 16], 'fontsize', fsize); %,... set(gca,'XTick',[0,0.01, 0.02, 0.03, 0.035, 0.04, 0.05, 0.06, 0.07, 0.08,... 0.09,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8],... 'XTickLabel',[0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8], 'fontsize', fsize); set(gcf, 'Position', [10 10 800 600]); %--------------------------------------------------------- % Save the output figure %--------------------------------------------------------- saveno = input('- Do you want to save the figure (y/n)? ', 's'); if strcmp(saveno, 'y') == 1 saveas(gcf, fname,'fig'); saveas(gcf, fname,'jpg'); end