Subtracting a value from a table column

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일

0 개 추천

small example:
% table with Var1 and Var2
a=table((1:1000)',(2001:3000)');
a.Var1(a.Var1>360)=a.Var1(a.Var1>360)-360

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2021a

태그

질문:

2021년 7월 8일

편집:

2021년 7월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by