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

3 visualizaciones (últimos 30 días)
Working with a Matlab table, not matrix, how can I replace all values less than X with Y in specific column?

Respuesta aceptada

the cyclist
the cyclist el 31 de Oct. de 2019
% 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

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by