Hello my questien i maby simple. But i vant an if funktion for a matrix.
my matrix could be like: A=[2 ; 0,6 ; 4 ; 0,9]
whant i vand to program is if A(i)<1 then A(i)=1 so the matrix should come out like: A=[2 ; 1 ; 4 ; 1]

댓글 수: 3

Jan
Jan 2013년 3월 13일
The matrix does not have valid Matlab syntax. Does "0,6" mean "0.6"? This details is important.
Claus Madsen
Claus Madsen 2013년 3월 13일
Yeah sry, it should be .
Image Analyst
Image Analyst 2013년 3월 14일
So, is it solved yet? You haven't marked either answer as "Accepted". What problems are you still encountering?

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

답변 (2개)

Image Analyst
Image Analyst 2013년 3월 13일

3 개 추천

Here's another way to do it (though my first thought was Cedric's way):
A = max(A,1);

카테고리

도움말 센터File Exchange에서 Food Sciences에 대해 자세히 알아보기

질문:

2013년 3월 13일

Community Treasure Hunt

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

Start Hunting!

Translated by