Error using vertcat. Dimensions of arrays being concatenated are not consistent.

1 view (last 30 days)
Hello,
I hope you are doing well.
I am working on a school project and I have an error that I unfortunately can't manage to understand. I am doing a mathematical modeling project where we have to use Newton's method on equations systems (in case this helps).
Here is what my console displays:
Error using vertcat
Dimensions of arrays being concatenated are not consistent.
Error in projet>@(x,y)[4*x^3,+12*y-8*x*(y^4);exp(-x^3+(y^2)/(x^2))-exp(5)] (line 51)
system2 = @(x,y)[4*x^3 +12*y - 8*x*(y^4); exp(-x^3 + (y^2)/(x^2)) - exp(5)];
Error in projet (line 56)
solution = solution(x,y)-(jacobian_system2_inverse(x,y))*(system2(x,y));
What confuses me is that the first half of the project works just fine. The Newton method seems well applied as the results given back are good.
But then, the second half, which is exactly the same thing but with different equations in it, suddenly returns an error.
You can find my whole work in the linked document.
Thank you in advance for your help,
Chloé

Accepted Answer

darova
darova on 29 May 2020
Make sure that all your spaces correct
Here is example
[1 -1; 1 2] % ok
[1 - 1; 1 2] % error

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!