Subtracting a value from a table column

10 ビュー (過去 30 日間)
Natasha Bryan
Natasha Bryan 2021 年 7 月 8 日
編集済み: Jonas 2021 年 7 月 8 日
Hello, I am new to Matlab and still trying to learn the language.
I am trying to say: "Where a value in column x of table y > 360, subtract 360" but struggling to translate this.
I realise this should be a really quick and easy thing but have landed up going down many rabbit holes trying to find a solution!
Any help would be greatly appreciated,
N

回答 (1 件)

Jonas
Jonas 2021 年 7 月 8 日
編集済み: Jonas 2021 年 7 月 8 日
small example:
% table with Var1 and Var2
a=table((1:1000)',(2001:3000)');
a.Var1(a.Var1>360)=a.Var1(a.Var1>360)-360

カテゴリ

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

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by