subtract value from column in table

29 ビュー (過去 30 日間)
Dion Theunissen
Dion Theunissen 2021 年 6 月 10 日
回答済み: Scott MacKenzie 2021 年 6 月 10 日
hi,
I want to subtract a table column from a value.
like this:
for c = 1:8
minus = table2array(Scan(1,c));
Scan(:,c) = (Scan(:,c)-minus);
end
but i get the error that operator '-' is not supported in tables.
How can I fix this?

採用された回答

Scott MacKenzie
Scott MacKenzie 2021 年 6 月 10 日
You need to use braces:
Scan{:,c} = (Scan{:,c}-minus);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by