Plotting/Graphing Vertical Force Data compared to sacral marker height data
Show older comments
I'm trying to figure out how to Interpolate my force data to be the same length as my sacral trajectory data and then plot both the vertical force and vertical sacral data on the same plot, but my vertical force data is showing a flat line... Not sure what's going on. Here is my code:
cd('C:\Excel Spreadsheets')
%Column of Data
a = xlsread('Assign 7_Increased_01.xlsx','H6:H3225');
b = xlsread('Assign 7_Increased_01.xlsx','W6:W649');
%Interpolation
a1 = interp1(a, linspace(1, length(a),101));
b1 = interp1(b, linspace(1, length(b),101));
yyaxis left
title('Normal Countermovement Jump')
xlabel('Normalized Time(%)')
ylabel('Vertical Force(N)')
plot(a1)
yyaxis right
hold on
ylabel('Sacral Marker Position(m)')
plot(b1)
xlim([0 101])
legend('Fz','Sacrum Z')
Answers (1)
KSSV
on 11 Mar 2019
cd('C:\Excel Spreadsheets')
%Column of Data
a = xlsread('Assign 7_Increased_01.xlsx','H6:H3225');
b = xlsread('Assign 7_Increased_01.xlsx','W6:W649');
%Interpolation
a1 = interp1(a, linspace(1, length(a),1:101));
b1 = interp1(b, linspace(1, length(b),1:101));
yyaxis left
title('Normal Countermovement Jump')
xlabel('Normalized Time(%)')
ylabel('Vertical Force(N)')
plot(a1)
yyaxis right
hold on
ylabel('Sacral Marker Position(m)')
plot(b1)
xlim([0 101])
legend('Fz','Sacrum Z')
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!