Replace all numbers in a cell array that are less than 10 to 10.
조회 수: 2 (최근 30일)
이전 댓글 표시
I have a cell array that holds mutiple different sized cell arrays inside it. The values are all numbers. I want to replace all numbers that are less than 10 to 10.
Thanks in advance!
댓글 수: 0
채택된 답변
Walter Roberson
2019년 4월 24일
cellfun(@(C) cellfun(@(M) max(M,10), C, 'uniform', 0), YourOuterCellArray, 'uniform', 0)
댓글 수: 4
Walter Roberson
2019년 4월 24일
편집: Walter Roberson
2019년 4월 24일
You had posted that you have a cell array that holds different sizes of cell arrays in it. However, that is not accurate: it holds different sizes of numeric arrays in it.
cellfun(@(THIS_IS_A_DUMMY_VARIABLE_THAT_STANDS_IN_FOR_A_PARTICULAR_ARRAY) max(THIS_IS_A_DUMMY_VARIABLE_THAT_STANDS_IN_FOR_A_PARTICULAR_ARRAY,10), h1c, 'uniform', 0)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!