hw08_resistance_yourlogin_solution

hw08_resistance_yourlogin_solution - title('Failure Time...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Programmer(s) and Purdue Email Address(es): % 1. login@purdue.edu % % Section: ALL % % Assignment #: Homework 8, Question 5 % % Academic Integrity Statement: % % I/we have not used source code obtained from % any other unauthorized source, either modified % or unmodified. Neither have I/we provided access % to my/our code to another. The project I/we am/are submitting % is my/our own original work. % % Program Description: In this program the student is asked to perform a % regression on temperature and resistivity data for a platinum resistance % thermometer. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % ---- Input Section ---- % % Read the data into MATLAB load 'hw08_problem5.txt'; resistance = hw08_problem5(:,1); failure_time = hw08_problem5(:,2); % ---- Calculation & Output Section ---- % % Generate a scatter plot of the data plot(resistance,failure_time,'or') % Formats the graph according to proper plotting format
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: title('Failure Time Plotted as a Function of Resistance for Overloaded Resistors') ylabel('Failure Time (minutes)') xlabel('Resistance (ohms)') % Determine the slope and intercept for the regression line coefficients = polyfit(resistance,failure_time,1); % Determine the predicted failure times (y values) using the original set % of resistances (x values) for the regression line. pred_failure_time = polyval(coefficients,resistance); % Add the regression line to the existing scatter plot hold on plot(resistance,pred_failure_time,'b') % Predict the failure time when the resistance is 42 ohms. predict_42ohms = polyval(coefficients,42); % Display the predicted and actual failure time for 42 ohms. disp('The predicted failure time (minutes) is:') disp(predict_42ohms) disp('The actual measured failure time (minutes) is:') disp(failure_time(15)) %----Comments----% The predicted failure time (minutes) is: 37.4472 % The actual measured failure time (minutes) is: 41 %...
View Full Document

This note was uploaded on 05/02/2011 for the course ENGR 132 taught by Professor Kutson during the Spring '11 term at Purdue University-West Lafayette.

Page1 / 2

hw08_resistance_yourlogin_solution - title('Failure Time...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online