Table, how to replace all values less than X with Y in specific column

조회 수: 4 (최근 30일)
newbie9
newbie9 2019년 10월 31일
답변: the cyclist 2019년 10월 31일
Working with a Matlab table, not matrix, how can I replace all values less than X with Y in specific column?

채택된 답변

the cyclist
the cyclist 2019년 10월 31일
% Create a table with two variables
a = [1;2;3];
b = [4;5;6];
tbl = table(a,b);
% For one of the variables, replaces values less than 2 with 3.14
tbl.a(tbl.a<2) = 3.14

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by