Mean value of two variables from an array with less than condition.
이전 댓글 표시
if mean(x(2:end,1),x(1:end-1,1)) < 0.01
do something;
end
For some cases my mean value is actually 0.01 but it is still going into the loop. I am not sure why. I have also tried lt(mean(x(2:end,1),x(1:end-1,1)),0.01) but it is still not working for me.
Thank you in advance for your help.
댓글 수: 1
Geoff Hayes
2019년 7월 18일
Manan - are you sure that your mean is actually 0.01 or is that just how the value that is displayed? See Set Command Window output display format for details.
Also, is
mean(x(2:end,1),x(1:end-1,1))
valid? Can you pass two arrays as inputs to the mean function?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!