Replacing individual Values in Data column based on a condition
조회 수: 23 (최근 30일)
이전 댓글 표시
Hello!
I am new to matlab and programming in generall. I have been working with a large data table. I have a few outliers in one o the columns and would like to replace them with the value 1.
However, I keep getting the error "Right hand side of an assignment into a table must be another table or a cell array."
Here is my code. Any help is appreciated!
myData=db_data.dataTable;
myData(myData.fluid_p_rel<0.9,:)=[1];
myData(myData.fluid_p_rel>1.2,:)=[1];
댓글 수: 0
채택된 답변
Stephen23
2019년 5월 9일
idx = myData.fluid_p_rel<0.9 | myData.fluid_p_rel>1.2;
myData.fluid_p_rel(idx) = 1
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!