Plotting/Graphing Vertical Force Data compared to sacral marker height data
显示 更早的评论
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')
回答(1 个)
KSSV
2019-3-11
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')
类别
在 帮助中心 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!