subtract value from column in table

28 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by