Code for Jacobi's method using only one for loop

Hello all, I am very new to matlab. I need to write a code to the Jacobi method implementing only one for loop. I have found here a code with 2 for loops. Anyone have any suggestions as to how to create this code? Thanks! http://www.mathworks.com/matlabcentral/fileexchange/2182-numerical-methods-using-matlab--3e/content/edition3/jacobi.m

1 件のコメント

Geoff Hayes
Geoff Hayes 2016 年 2 月 21 日
Greta - is this homework? Please describe why only one loop is needed and what you have attempted so far.

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

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2016 年 2 月 23 日

0 投票

Hi Greta! Please use function eye and diag for vectorization second loop.

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

質問済み:

2016 年 2 月 20 日

回答済み:

2016 年 2 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by