Perhaps a bug in matlab?

조회 수: 1 (최근 30일)
Mohammad Shojaei Arani
Mohammad Shojaei Arani 2022년 1월 23일
편집: Walter Roberson 2022년 1월 23일
Hello friends!
I think I have encountered a bad issue about matlab, perhaps it is a bug. Consider the following commands
>> syms x x0 a b
>> f=int(1/(a+b*x),x)
f =log(a + b*x)/b
but now, trhe following command does not give me the result it should (it feels as if matlab is unable to solve this easy integration)
>> f=int(1/(a+b*x),x,x0,x)
f =int(1/(a + b*x), x, x0, x)
and I have to fix this by the command f=int(1/(a+b*x),x);f=f-subs(f,x,x0). Note that, in some other cases matlab does the job correctly, for instance:
f=int(sin(x),x,x0,x)
f =cos(x0) - cos(x)
It took a rather long time for me to understand why my code (not these stuff. I am talking about a very big code where these stuff were just a tiny part of it) does not produce the result it must produce.
I hope matlab developers really correct such bugs! Very annoying part is that matlab is not free and has such problems!!!

답변 (1개)

Walter Roberson
Walter Roberson 2022년 1월 23일
편집: Walter Roberson 2022년 1월 23일
It is correct that it should not be giving you the solution. Your equations do not account for the possibility that you might be integrating through a discontinuity.
syms x x0 a b real
f = int(1/(a+b*x), x, x0, x, 'ignoreanalytic', true)
f = 

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by