Calculation of fascicle length and pennation angle

This functions calculates fascicle length and pennation angles of a muscles 3d data set.
229 Downloads
Updated 16 Apr 2013

View License

%% under construction!
Some paths do not seem to work properly. I will correct this in the next few days.

To calculates the length and angles you need the following:
- a set of 3d data of the muscles fascicles
- coordinates of the force axis
- coordinates of the anatomical landmarks from the calcaneus, the fibula and the main direction of the foot

- the coefficients of the polynomials got calculates with coeffvalues.m

code of the functions polynomtestlin, polynomtest22 and polynomtest33:

function [coefftest]=polynomtest33(AWert,CWert)

% %POLYNOMTEST33 Create plot of datasets and fits

% % POLYNOMTEST33(AWERT,CWERT)

% % Creates a plot, similar to the plot in the main curve fitting

% % window, using the data that you provide as input. You can

% % apply this function to the same data you used with cftool

% % or with different data. You may want to edit the function to

% % customize the code and this help message.

% %

% % Number of datasets: 1

% % Number of fits: 1

%
%

% % Data from dataset "CWert vs. AWert":

% % X = AWert:

% % Y = CWert:

% % Unweighted

% %

% % This function was automatically generated on 09-Feb-2011 13:59:28

%
%
% Set up figure to receive datasets and fits

% f_ = clf;

% figure(f_);

% set(f_,'Units','Pixels','Position',[943 394 680 484]);

% legh_ = []; legt_ = {};
% handles and text for legend

% xlim_ = [Inf -Inf];
% limits of x axis

% ax_ = axes;

% set(ax_,'Units','normalized','OuterPosition',[0 0 1 1]);

% set(ax_,'Box','on');

% axes(ax_); hold on;

%
%

% % --- Plot data originally in dataset "CWert vs. AWert"

% AWert = AWert(:);

% CWert = CWert(:);

% h_ = line(AWert,CWert,'Parent',ax_,'Color',[0.333333 0 0.666667],...

% 'LineStyle','none', 'LineWidth',1,...

% 'Marker','.', 'MarkerSize',12);

% xlim_(1) = min(xlim_(1),min(AWert));

% xlim_(2) = max(xlim_(2),max(AWert));

% legh_(end+1) = h_;

% legt_{end+1} = 'CWert vs. AWert';

%
%
% Nudge axis limits beyond data limits

% if all(isfinite(xlim_))

% xlim_ = xlim_ + [-1 1] * 0.01 * diff(xlim_);

% set(ax_,'XLim',xlim_)

% else

% set(ax_, 'XLim',[67.61313437675885, 89.315211296848659]);

% end

% --- Create fit "fit 30"
ok_ = isfinite(AWert) & isfinite(CWert);
if ~all( ok_ )
warning( 'GenerateMFile:IgnoringNansAndInfs', ...
'Ignoring NaNs and Infs in data' );
end
ft_ = fittype('poly3');

% Fit this model using new data
cf_ = fit(AWert(ok_),CWert(ok_),ft_);

% % Or use coefficients from the original fit:
% if 0
% cv_ = { 0.00017185714749200226, -0.046155284038860329, 4.1919924194089013, -127.69125063698891};
% cf_ = cfit(ft_,cv_{:});
% end
coefftest=cf_;
% % Plot this fit
% h_ = plot(cf_,'fit',0.95);
% legend off; % turn off legend from plot method call
% set(h_(1),'Color',[1 0 0],...
% 'LineStyle','-', 'LineWidth',2,...
% 'Marker','none', 'MarkerSize',6);
% legh_(end+1) = h_(1);
% legt_{end+1} = 'fit 30';
%
% % Done plotting data and fits. Now finish up loose ends.
% hold off;
% leginfo_ = {'Orientation', 'vertical', 'Location', 'NorthEast'};
% h_ = legend(ax_,legh_,legt_,leginfo_{:}); % create legend
% set(h_,'Interpreter','none');
% xlabel(ax_,''); % remove x label

% ylabel(ax_,'');
% remove y label

Additionally you can calculate the proximal and distal aponeurosis.

Cite As

Philipp Schenk (2024). Calculation of fascicle length and pennation angle (https://www.mathworks.com/matlabcentral/fileexchange/41106-calculation-of-fascicle-length-and-pennation-angle), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2011a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Linear and Nonlinear Regression in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.3.0.0

error discovered

1.2.0.0

added polynomtestlin/22 and 33 code

1.0.0.0