I need help using the quad function
이전 댓글 표시
When using the quad function to integrate, I am getting the error:
FUN must be a function, a valid string expression, or an inline function object.
I am trying to integrate the polyval.
Here is my code. How do I fix it to integrate the function and avoid this error message?
function [ A ] = func( x )
clear all clc
A=5;
B=25;
x=[0 10];
y=[A B];
p=polyfit(x,y,1);
func=polyval(p,x);
q=quad(func,0,10)
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!