Different output using mldivide with newer matlab version
Problem introduction
I have a simple system of 4 linear equations with 4 unknowns, which can be written as . The content of the matrices is written out below.
The analytical solution to this equation is
Observation
Asking MATLAB R2017b to solve this system using mldivide returns the exact answer. However, MATLAB R2024a returns a slightly different answer for the exact same question, where 3 out of the 4 elements in x are off to the order of 1e-11.
This exact observation can be reproduced using the attached files. First, run test1_R2017b.m in R2017b, then run test2_R2024a.m in R2024a.
Question
Simply; how come?
Is it simply a numerical error? What is the difference in mldivide between R2017b and R2024a? I read in the release notes that there is an Improved performance with small matrices to mldivide in R2022b. Is this the cause?
And how can I overcome this issue? A lot of my test functions are failing; is there a proper, robust fix for this? Or should I take a close look at my failing test functions and update them if possible? Any other suggestions?Problem introduction
I have a simple system of 4 linear equations with 4 unknowns, which can be written as . The content of the matrices is written out below.
The analytical solution to this equation is
Observation
Asking MATLAB R2017b to solve this system using mldivide returns the exact answer. However, MATLAB R2024a returns a slightly different answer for the exact same question, where 3 out of the 4 elements in x are off to the order of 1e-11.
This exact observation can be reproduced using the attached files. First, run test1_R2017b.m in R2017b, then run test2_R2024a.m in R2024a.
Question
Simply; how come?
Is it simply a numerical error? What is the difference in mldivide between R2017b and R2024a? I read in the release notes that there is an Improved performance with small matrices to mldivide in R2022b. Is this the cause?
And how can I overcome this issue? A lot of my test functions are failing; is there a proper, robust fix for this? Or should I take a close look at my failing test functions and update them if possible? Any other suggestions? Problem introduction
I have a simple system of 4 linear equations with 4 unknowns, which can be written as . The content of the matrices is written out below.
The analytical solution to this equation is
Observation
Asking MATLAB R2017b to solve this system using mldivide returns the exact answer. However, MATLAB R2024a returns a slightly different answer for the exact same question, where 3 out of the 4 elements in x are off to the order of 1e-11.
This exact observation can be reproduced using the attached files. First, run test1_R2017b.m in R2017b, then run test2_R2024a.m in R2024a.
Question
Simply; how come?
Is it simply a numerical error? What is the difference in mldivide between R2017b and R2024a? I read in the release notes that there is an Improved performance with small matrices to mldivide in R2022b. Is this the cause?
And how can I overcome this issue? A lot of my test functions are failing; is there a proper, robust fix for this? Or should I take a close look at my failing test functions and update them if possible? Any other suggestions? mldivide, system, equation MATLAB Answers — New Questions