Error: "Difference order N must be a positive integer scalar" when called symbolic gradient function
이전 댓글 표시
In my program, I first use command jacobian generate a symbolic gradient of my objective function.Then I call the function(gradient.m) and feed it with numeric value. But Matlab warned me like
Warning: Function "diff" is not verified to be a valid MATLAB
function.
Warning: Function "diff" is not verified to be a valid
MATLAB function.
Warning: Function "diff" is not verified to be a valid
MATLAB function.
Error using diff
Difference order N must be a positive integer scalar.
Error in gradient (line 10)
t4 = diff(t2,B1);
Error in mini_dist_noheter (line 60)
dfb = gradient(b(1),b(2),b(3));
The gradient function file, main file and data see the attachment.
댓글 수: 2
The error message seems quite clear.
In your command
t4 = diff(t2,B1)
B1 is not a positive integer.
Best wishes
Torsten.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!