I have this graph and i need to find the slope where is (2 – 14)
clear all;clc;gogn = xlsread(fullfile('C:\Users\ebben\Dropbox\HR\Eðlisfræði\Verklegt\Top','TOP_gogn.xlsx'));force=gogn(:,1);angle=gogn(:,2); % Data imported
% finding the slope
lm=fitlm(angle,force,'poly1'); hallatala=lm.Coefficients.Estimate; % value for slope in textbox
annotation('textbox', [.3 .245 .1 .1], 'String', ... ['Hallatala: ',num2str(hallatala(2,1))]); % ploting data
plot(angle,force,'r.')hold on % ploting the slope line
besta_lina=hallatala(2,1)*angle + hallatala(1,1);plot(angle,besta_lina,'k','Linewidth',2)xlabel('angle[rad]');ylabel('force[N]');
gridtitle(['TOP'])
Best Answer