Replace A single element of matrix

Hi, what I want to do is replace a single value in the 201X201 identity matrix to form a transformation matrix. I know how to form the identity matrix, but im having trouble figuring out how to replace a value. I want to replace the zero in the 201st row and 1st column with a 240. I know this probably has a an easy solution, but any help is appreciated, thanks!

 採用された回答

dpb
dpb 2016 年 6 月 28 日

4 投票

x(201,1)=240;

3 件のコメント

Odom Seng
Odom Seng 2016 年 6 月 28 日
thanks for your reply, but this just gives me a 201 X 1 vector with a 240 at the bottom. I basically want the 201 * 201 identity matrix but with a 240 in the 201 X 1 spot.
James Tursa
James Tursa 2016 年 6 月 28 日
dpb's post assumed you had already formed the identity matrix. If not, then create it first. E.g.,
x = eye(201);
x(201,1) = 240;
Odom Seng
Odom Seng 2016 年 6 月 28 日
Well that's embarrassing! Thanks for the quick replies, much appreciated.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeNumeric Types についてさらに検索

製品

質問済み:

2016 年 6 月 28 日

コメント済み:

2016 年 6 月 28 日

Community Treasure Hunt

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

Start Hunting!

Translated by