Below is a demonstration of the features of the importFEBio_logfile function


clear; close all; clc;




This function imports FEBio output log files such as for node outputs (e.g. displacement) and element outputs (e.g. stress). The inputs include the file name to import as well as the following optional inputs:


% Path names
defaultFolder = fileparts(fileparts(mfilename('fullpath')));

% Defining file names
febioFebFileName=fullfile(savePath,[febioFebFileNamePart,'.feb']); %FEB file name
febioLogFileName=[febioFebFileNamePart,'.txt']; %FEBio log file name
febioLogFileName_disp=[febioFebFileNamePart,'_disp_out.txt']; %Log file name for exporting displacement
febioLogFileName_stress=[febioFebFileNamePart,'_stress_out.txt']; %Log file name for exporting stress sigma_z

Check for existing output files in the temp folder. Run febio demo 1 if not found.

if ~exist(febioLogFileName_disp,'file')

Importing nodal displacements from a log file

Importing the output data into a data structure:

dataStruct = 

  struct with fields:

    time: [11×1 double]
    data: [216×3×11 double]

The data structure contains the time vector and the data. For k dimensional data, n nodes (or elements), and m time steps the data is nxkxm+1 (or m when the initial state is not requested or not added by FEBio).

%Access data; %Displacement data
timeVec=dataStruct.time; %Time vector


Kevin Mattheus Moerman, [email protected]

GIBBON footer text


GIBBON: The Geometry and Image-based Bioengineering add-On. A toolbox for image segmentation, image-based modeling, meshing, and finite element analysis.

Copyright (C) 2006-2023 Kevin Mattheus Moerman and the GIBBON contributors

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see