what is wrong with my code? film() says too many input arguments

조회 수: 2 (최근 30일)
Luis Gonzalez
Luis Gonzalez 2022년 6월 3일
댓글: Walter Roberson 2022년 6월 4일
Hello im trying to do a least squares code , i got almost everything except that when i use the function "fitlm" it says error all the time too many input arguments
matriz=readmatrix('ejemplo.csv')
x=matriz(:,1); y=matriz(:,2)
xy=x.*y
x2=x.^2
table(x,y,xy,x2)
[m,b]=minimosC(x,y)
mdl= fitlm(x,y);
rsq=mdl.Rsquared.Ordinary
recta=m*x+b
fprintf('El modelo lineal predice el %0.4',rsq*100)
plot(x,y,'.g','MarkerSize',10)
hold on
plot(x,recta)
grid on
title("m="+m+"b="+b+"R2="+rsq)
xlabel('valores x')
ylabel('valores y')
legend('datos','Ecuacion Lineal','location','bestoutside')
heres my code if someone could help i'd appreciate it :)
  댓글 수: 14
Voss
Voss 2022년 6월 4일
Excellent! You're welcome!
Walter Roberson
Walter Roberson 2022년 6월 4일
Use the debugging
dbstop if error
run the code. When it stops examine size(model) and check
which std(model(1).y_r)

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by