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

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 日

0 投票

% 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 件)

カテゴリ

ヘルプ センター および File ExchangeTables についてさらに検索

タグ

質問済み:

2019 年 10 月 31 日

回答済み:

2019 年 10 月 31 日

Community Treasure Hunt

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

Start Hunting!

Translated by