HOW DO I MAKE A FUNCTION THAT CHANGES MY FORCE VS. TIME GRAPH TO FORCE VS. POSITION
Hello, I plotted a graph that gave me force vs. position but I need to make it so it gives me force vs. time but I am not sure on how to convert the time. I am given the sample rate which is 20 samples per second and the crosspeed is 15 inches per minute. but if the sample rate fluctuates, how can I obtain the actual distance ? I hope this makes sense, anything helps
files = [
"Test 22 Sensor.txt" "Test 22 Instron.TXT";
%%"Test 17 Sensor.txt" "Test 17 Instron.TXT";
];
Valueshift=12.53-6.18;
% value that is adjusted in case the final cross value is not
% correct and the graphs do not match up
SampleRate=10;
% sample rate of the Instron machine
NamedGraphTitle=["2022.03.16 Test 22, .012in Uncoated, 7000lbs, 15in per min"];
TimeendX=20;
%the last value for the axis
% Import the data
for k=1:size(files)
TestSensor = readtable(files(k,1),opts);
TestInstron = readtable(files(k,2),opts_instron);
% transfer the table data to the array
sensor_data = table2array(TestSensor(2:height(TestSensor)-2,:));
instron_data = table2array(TestInstron(2:height(TestInstron),:));
% Plotting
%Pulling Force
plot(sensor_data_shift.*mask,sensor_data(:,3).*mask,’LineWidth’,1.5,’Color’,[0.267, 0.447, 0.769])% RGB Blue 68, 114, 196
hold on
%Normal Force
plot(instron_data(:,1)/SampleRate+gap,instron_data(:,3),’LineWidth’,1.5,’Color’,[0.929, 0.490, 0.192])% RGB Orange 237, 125, 49
%Friction
% RGB Grey 165, 165, 165
legend(‘Normal Force’,’Pulling Force’,’Friction*1000′)
grid on
title(NamedGraphTitle)
xlabel(‘Time(s)’)
ylabel(‘Force (lbs)’)
axis([16.5,TimeendX,0,7500])
hold off
endHello, I plotted a graph that gave me force vs. position but I need to make it so it gives me force vs. time but I am not sure on how to convert the time. I am given the sample rate which is 20 samples per second and the crosspeed is 15 inches per minute. but if the sample rate fluctuates, how can I obtain the actual distance ? I hope this makes sense, anything helps
files = [
"Test 22 Sensor.txt" "Test 22 Instron.TXT";
%%"Test 17 Sensor.txt" "Test 17 Instron.TXT";
];
Valueshift=12.53-6.18;
% value that is adjusted in case the final cross value is not
% correct and the graphs do not match up
SampleRate=10;
% sample rate of the Instron machine
NamedGraphTitle=["2022.03.16 Test 22, .012in Uncoated, 7000lbs, 15in per min"];
TimeendX=20;
%the last value for the axis
% Import the data
for k=1:size(files)
TestSensor = readtable(files(k,1),opts);
TestInstron = readtable(files(k,2),opts_instron);
% transfer the table data to the array
sensor_data = table2array(TestSensor(2:height(TestSensor)-2,:));
instron_data = table2array(TestInstron(2:height(TestInstron),:));
% Plotting
%Pulling Force
plot(sensor_data_shift.*mask,sensor_data(:,3).*mask,’LineWidth’,1.5,’Color’,[0.267, 0.447, 0.769])% RGB Blue 68, 114, 196
hold on
%Normal Force
plot(instron_data(:,1)/SampleRate+gap,instron_data(:,3),’LineWidth’,1.5,’Color’,[0.929, 0.490, 0.192])% RGB Orange 237, 125, 49
%Friction
% RGB Grey 165, 165, 165
legend(‘Normal Force’,’Pulling Force’,’Friction*1000′)
grid on
title(NamedGraphTitle)
xlabel(‘Time(s)’)
ylabel(‘Force (lbs)’)
axis([16.5,TimeendX,0,7500])
hold off
end Hello, I plotted a graph that gave me force vs. position but I need to make it so it gives me force vs. time but I am not sure on how to convert the time. I am given the sample rate which is 20 samples per second and the crosspeed is 15 inches per minute. but if the sample rate fluctuates, how can I obtain the actual distance ? I hope this makes sense, anything helps
files = [
"Test 22 Sensor.txt" "Test 22 Instron.TXT";
%%"Test 17 Sensor.txt" "Test 17 Instron.TXT";
];
Valueshift=12.53-6.18;
% value that is adjusted in case the final cross value is not
% correct and the graphs do not match up
SampleRate=10;
% sample rate of the Instron machine
NamedGraphTitle=["2022.03.16 Test 22, .012in Uncoated, 7000lbs, 15in per min"];
TimeendX=20;
%the last value for the axis
% Import the data
for k=1:size(files)
TestSensor = readtable(files(k,1),opts);
TestInstron = readtable(files(k,2),opts_instron);
% transfer the table data to the array
sensor_data = table2array(TestSensor(2:height(TestSensor)-2,:));
instron_data = table2array(TestInstron(2:height(TestInstron),:));
% Plotting
%Pulling Force
plot(sensor_data_shift.*mask,sensor_data(:,3).*mask,’LineWidth’,1.5,’Color’,[0.267, 0.447, 0.769])% RGB Blue 68, 114, 196
hold on
%Normal Force
plot(instron_data(:,1)/SampleRate+gap,instron_data(:,3),’LineWidth’,1.5,’Color’,[0.929, 0.490, 0.192])% RGB Orange 237, 125, 49
%Friction
% RGB Grey 165, 165, 165
legend(‘Normal Force’,’Pulling Force’,’Friction*1000′)
grid on
title(NamedGraphTitle)
xlabel(‘Time(s)’)
ylabel(‘Force (lbs)’)
axis([16.5,TimeendX,0,7500])
hold off
end plotting, convert, speed, time MATLAB Answers — New Questions