Engineering Data Processing in MATLAB
How to use MATLAB for processing FEA results, load spectra, fatigue data and vibration signals — practical workflows and code examples.
Engineering Task
Using MATLAB to process, analyse and visualise engineering data from FEA results, test measurements or load spectra.
Reading FEA Results
- Abaqus: export field output as .rpt (ASCII); parse with textscan and custom format strings
- Nastran: read F06 or OP2 files; use regexp to extract grid point force or stress tables
- ANSYS: export results as CSV or APDL output files; read with readmatrix
- Use readtable for structured CSV exports from any solver
Rainflow Cycle Counting
MATLAB's Signal Processing Toolbox includes the rainflow function for counting fatigue cycles from time histories.
cycles = rainflow(stress_time_history); ranges = cycles(:,1); means = cycles(:,2); counts = cycles(:,3); amplitudes = ranges / 2;
S-N Curve Implementation
Implement S-N curves as anonymous functions or lookup tables with log-log interpolation.
% Basquin equation: N_fail = @(Sa) ((Sa / sf_prime) .^ (1/b)) / 2; % Goodman correction: Sa_equiv = @(Sa, Sm) Sa ./ (1 - Sm ./ Ftu);
PSD Processing
- Use pwelch for PSD estimation from acceleration time histories
- Use fft for frequency-domain analysis
- Use interp1 for resampling or frequency-domain interpolation
- Verify units: g²/Hz for acceleration PSD; Pa²/Hz for stress PSD
Useful Toolboxes
| Toolbox | Engineering Use |
|---|---|
| Signal Processing | Rainflow, PSD, FFT, filtering |
| Statistics and ML | Distribution fitting, reliability |
| Optimisation | Parameter fitting, structural optimisation |
| Symbolic Math | Algebraic manipulation, derivation |
| PDE Toolbox | Simple 2D FEA / heat conduction |