Info

この質問は閉じられています。 編集または回答するには再度開いてください。

INNER DIMENSIONS MUST AGREE

1 回表示 (過去 30 日間)
KAPIL MAMTANI
KAPIL MAMTANI 2016 年 4 月 27 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hi, I am having trouble in my code as I am trying to solve set of ODE`s and Exponential equations all 9 of them are dependent on each other and need to be solved simultaneously. Please someone see through it and help me. I am attaching my code.
  1 件のコメント
Jan
Jan 2016 年 4 月 28 日
Use a well tested ODE integrator of Matlab instead of a hard coded method without stepsize control.

回答 (2 件)

Muhammed Fasil
Muhammed Fasil 2016 年 4 月 28 日
In an assignment A(:) = B, the number of elements in A and B must be the same.
Error in Untitled (line 146) SOM(i+1) = SOM(i)+(s1+(2*s2)+(2*s3)+s4)*(h/6);
  2 件のコメント
KAPIL MAMTANI
KAPIL MAMTANI 2016 年 4 月 28 日
Mr Fasil i know that error is in that line....thank you very much
Jan
Jan 2016 年 4 月 28 日
@KAPIL MAMTANI: You knew it, but the readers in the forum did not get this information before.

Walter Roberson
Walter Roberson 2016 年 4 月 28 日
Your function handles for S and U and W involve the vector Y, so each place that it appears that you are calculating a scalar in the loop, s1, s2, and so on, you are calculating a vector; the one exception is t1. You can index that vector afterwards, but if you are going to be doing that you should be asking why you are calculating the entire vector: it probably indicates a logic error in your code.
  2 件のコメント
KAPIL MAMTANI
KAPIL MAMTANI 2016 年 4 月 28 日
sir, Actually i need you to check whether i am solving these quations correctly in matlab....is the interdependency for variables among ODEs and Exponential equations is good.
Jan
Jan 2016 年 4 月 28 日
編集済み: Jan 2016 年 4 月 28 日
@KAPIL MAMTANI: How could we know? All we see is your code, so we cannot compare it with what you intented to implement.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by