Main Content

meanfailplot

Plot failure times of accelerated life model

Since R2026a

Description

meanfailplot(mdl) plots the failure times mdl.FailureTimes versus the stressor levels mdl.StressorLevels in the AcceleratedLifeModel object mdl. If mdl contains one stressor, the function creates a scatter plot of the data and a line representing the fitted mean failure times. If mdl contains two stressors, the function creates a 3-D scatter plot of the data and a surface that represents the fitted mean failure times.

To return the mean failure times, use the meanfailtime function.

example

meanfailplot(mdl,X1) plots a fitted model line over the range of stressor levels X1. The accelerated life model mdl must contain only one stressor.

example

meanfailplot(mdl,X1,X2) plots a fitted model surface over the range of stressor levels [X1 X2], where X1 is a numeric vector of values for the first stressor, and X2 is a numeric vector of values for the second stressor. mdl must contain two stressors.

meanfailplot(___,BaselineStressorLevel=baseline) adds a plot marker on the fitted model line or surface at the stressor level baseline, using any of the input argument combinations in the previous syntaxes. The number of elements in baseline must equal the number of stressors in mdl.

meanfailplot(ax,___) uses the plot axes specified by the Axes object ax. The option ax can precede any of the input argument combinations in the previous syntaxes.

h = meanfailplot(___) returns the handles (h) to the fitted line or surface in the mean failure time plot.

Examples

collapse all

Load the diodeFailure data set, which contains simulated observations of failure times for a diode at different current levels.

load diodeFailure.mat

Fit an accelerated life model to the data in the diodeFailure table using the fitacclife function. Specify a power law life stress model and use the FailureTime table variable as the failure times.

mdl = fitacclife(diodeFailure,"FailureTime",StressModel="power")
mdl = 
AcceleratedLifeModel

Life distribution: weibull
Stress model: power

    Current    WeibullA    MeanFailureTime
    _______    ________    _______________

      10        1.4869           1.41     
       5        2.8445         2.6973     
       3         4.588         4.3506     


Log-likelihood: -3.6697

mdl is an AcceleratedLifeModel object, which contains information about the fitted model coefficient estimates. By default, the fitacclife function uses a Weibull life distribution. The first column of the displayed output lists the unique stressor levels in diodeFailure. The second and third columns list the fitted life distribution values and mean failure times, respectively.

Use the meanfailtime function to compute the predicted mean failure time and the Weibull life distribution parameter at current levels 12 and 15.

[meanFailTimes,lifeCoeffs] = meanfailtime(mdl,[12; 15])
meanFailTimes=2×2 table
    Current    MeanFailureTime
    _______    _______________

      12            1.1888    
      15           0.96474    

lifeCoeffs=2×2 table
    Current    WeibullA
    _______    ________

      12        1.2537 
      15        1.0174 

Create a plot of failure time versus current level.

meanfailplot(mdl)

Figure contains an axes object. The axes object with title Failure Time Plot, xlabel Current, ylabel Failure Time contains 4 objects of type line. One or more of the lines displays its values using only markers These objects represent Mean Failure Time, 3, 5, 10.

The plot shows that the mean failure time decreases nonlinearly with increasing current level.

Input Arguments

collapse all

Accelerated life model, specified as an AcceleratedLifeModel object created using fitacclife.

First stressor values, specified as a numeric vector. If mdl has one stressor, the meanfailplot function plots a segmented line that connects the mean failure time values at the stressor levels X1.

If mdl has two stressors:

  • You must specify X2.

  • The function plots a surface with grid points at X1 for the first stressor.

Data Types: single | double

Second stressor values, specified as a numeric vector. The meanfailplot function plots a fitted surface with grid points at X2 for the second stressor. You can only specify X2 when mdl contains two stressors.

Data Types: single | double

Baseline stressor level, specified as a numeric vector. baseline must have the same length as mdl.StressorNames. The meanfailplot function plots a marker at the interpolated (or extrapolated) mean failure time at the stressor level baseline.

Data Types: single | double

Axes for the plot, specified as an Axes object. If you do not specify ax, then meanfailplot creates the plot using the current axes. For more information on creating an Axes object, see axes.

Output Arguments

collapse all

Graphics objects, returned as a graphics array. If mdl has one stressor, then the elements of h are line objects. Otherwise, h contains elements corresponding to the surface and the unique stressor levels in Mdl.StressorLevels.

If you specify baseline, or if mdl.BaselineStressorLevel is not empty, h also contains a line object corresponding to the baseline stressor level.

Version History

Introduced in R2026a