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

조회 수: 3 (최근 30일)
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é

채택된 답변

darova
darova 2020년 5월 29일
Make sure that all your spaces correct
Here is example
[1 -1; 1 2] % ok
[1 - 1; 1 2] % error
  댓글 수: 1
Chloé Stéphan
Chloé Stéphan 2020년 5월 29일
You're right ! I didn't know that arrays were space sensitive in Matlab. Thank you very much !

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by