フィルターのクリア

Parse error at '=' and ')' in FEM approach

1 回表示 (過去 30 日間)
Jake
Jake 2020 年 4 月 16 日
コメント済み: Jake 2020 年 4 月 17 日
Hi,
Following is my code and it is related to FEM.
T = zeros(10,5);
T(1:10,1) = 10;
T(1:10,5) = 50;
T(1,2) = 73;
T(1,3) = 100;
T(1,4) = 85;
for n=1:9
for i =2:4
(1/6)*0.1*(T(n+1,i-1)-(T(n,i-1)))+(2/3)*0.1*(T(n+1,i)-T(n,i))+(1/6)*0.1*(T(n+1,i+1)-T(n,i+1)) = 2*(T(n,i+1)-2*T(n,i)+T(n,i-1));
end
end
I'm getting the following errors.
"Parse error at '=': usage might be invalid MATLAB syntax" (Line 10)
"Parse error at ')': usage might be invalid MATLAB syntax" (Line 10)
This is my first attempt in this kind of mathematical approach and I'm sure the code is pretty primary, to say the least. However, Can anyone tell me what should I try to fix this?
TIA!
  4 件のコメント
Geoff Hayes
Geoff Hayes 2020 年 4 月 17 日
A problem is the left-hand sign of your equation - you are not assigning the right-hand side to something on the left-hand side since it (the left) is an equation in its own right. Consider the answer from the link you posted
T(n+1,i) = T(n,i) + 0.3*(T(n,i+1)-2*T(n,i)+T(n,i-1));
You will (somehow) need to formulate your new equation like this one where an equation/calculation on the right is assigned to an array element on the left. Or perhaps for FEM (which I have no experience) there is an alternative workflow that you can follow.
Jake
Jake 2020 年 4 月 17 日
That does make sense. I will try to find more help with FEM in matlab here as well.
Thank you, Geoff!

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeArgument Definitions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by