Set lower than 0.1 values to zero in tables that stored in a cell

조회 수: 12 (최근 30일)
BN
BN 2020년 5월 28일
댓글: BN 2020년 5월 28일
Dear all,
In a 1x3 cell containing three (28x6) tables; inside tables how I can set each value that lower than 0.1 to zero in a1 and a2 columns (names of columns are a1 and a2) of all tables?
Thank you all

채택된 답변

Fangjun Jiang
Fangjun Jiang 2020년 5월 28일
In general, this is how you do it. Apply it to a table inside a cell should not be that difficult.
a=rand(3,5);
index=a<0.5;
a(index)=0
  댓글 수: 3
Fangjun Jiang
Fangjun Jiang 2020년 5월 28일
편집: Fangjun Jiang 2020년 5월 28일
If the data inside the cell is array (not table object), then you can do this
cellfun(@(x) x(x<0.1)=0, C, 'UniformOutput', false);

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by