フィルターのクリア

Replacing element in table

3 ビュー (過去 30 日間)
Sebastian Daneli
Sebastian Daneli 2021 年 11 月 15 日
コメント済み: Sebastian Daneli 2021 年 11 月 15 日
I have this table
X1=[9 6 9;3 2 7];
X2=[0 2;4 0];
X3=[3 1; 8 9];
X=table(X1,X2,X3)
X = 2×3 table
X1 X2 X3 ___________ ______ ______ 9 6 9 0 2 3 1 3 2 7 4 0 8 9
How do I replace X3 with X1 so that i get
X1=[9 6 9;3 2 7];
X2=[0 2;4 0];
X3=X1;
X=table(X1,X2,X3)
X = 2×3 table
X1 X2 X3 ___________ ______ ___________ 9 6 9 0 2 9 6 9 3 2 7 4 0 3 2 7
Without having to make an new table that is.

採用された回答

Dave B
Dave B 2021 年 11 月 15 日
編集済み: Dave B 2021 年 11 月 15 日
You can do point to table variables with the syntax tablename.variablename:
X1=[9 6 9;3 2 7];
X2=[0 2;4 0];
X3=[3 1; 8 9];
X=table(X1,X2,X3)
X = 2×3 table
X1 X2 X3 ___________ ______ ______ 9 6 9 0 2 3 1 3 2 7 4 0 8 9
X.X3=X1 % or X.X3=X.X1 in this case
X = 2×3 table
X1 X2 X3 ___________ ______ ___________ 9 6 9 0 2 9 6 9 3 2 7 4 0 3 2 7
  1 件のコメント
Sebastian Daneli
Sebastian Daneli 2021 年 11 月 15 日
That was effective. Than you.

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

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by