MATLAB Object-Oriented Programming

(Joyce) #1
sprintf('Material: %s\nSample Number: %g\nModulus: %1.5g\n',...
td.Material,td.SampleNumber,td.Modulus)
end

function plot(td,varargin)
plot(td.Strain,td.Stress,varargin{:})
title(['Stress/Strain plot for Sample ',...
num2str(td.SampleNumber)])
xlabel('Strain %')
ylabel('Stress (psi)')
end
end
end

See Also


More About



  • “Class Components” on page 5-5


3 MATLAB Classes Overview

Free download pdf