what did i do wrong in here? error said I have wrong code for scatter(rate(:,1),rate(:,5),'o') but when I solved it, other codes are messed up how to solve it?
datacell = textscan( regexprep( fileread('cricketData.csv'),
'\$', '0' ), '%f%f', 'delimiter', ',', 'HeaderLines', 1);
Duration = datacell{1};
Input = datacell{1};
YourTable = table(Duration, Input);
temp=datacell(:,1);
rate=datacell(:,2);
scatter(rate(:,1),rate(:,5),'o')
xlabel('temperature(T in degrees Fahrenheit)')
ylabel('chirping (R in chirp per second))')
title('Chirping rate vs Temperature')
p=polyfit(rate(:,1),rate(:,2),1);
x=min(1)-2:.01:max(2)+2;
hold on
plot(x,polyval(p,x))
legend('Data points,''best fit equation')
fprintf('Calculated equation: Chirping rate(c/s)=(%.2f)(temperature
(F))+%.2f\n',p)
Answer:
datacell = textscan( regexprep(
fileread('cricketData.csv'), '\$', '0' ), '%f%f', 'delimiter', ',',
'HeaderLines', 1);
Duration = datacell{1};
Input = datacell{1};
YourTable = table(Duration, Input);
temp=datacell(:,1);
rate=datacell(:,2);
scatter(rate(:,1),(2:5)),'o')
xlabel('temperature(T in degrees Fahrenheit)')
ylabel('chirping (R in chirp per second))')
title('Chirping rate vs Temperature')
p=polyfit(rate(:,1),rate(:,2),1);
x=min(1)-2:.01:max(2)+2;
hold on
plot(x,polyval(p,x))
legend('Data points,''best fit equation')
fprintf('Calculated equation: Chirping rate(c/s)=(%.2f)(temperature
(F))+%.2f\n',p)
Explanation:
Get Answers For Free
Most questions answered within 1 hours.