Using while loop in normalized matrix
조회 수: 1 (최근 30일)
이전 댓글 표시
Hello,
How I should use 'while' loop to solve this problem?
I would like stop the program, when it will be x=1 and y=1 at the same moment?
a = 0.2;
b = 0.3;
c = rand
d = rand
m = [a c; b d];
d=normc(m);
x = d(1,1)+d(2,1)
y = d(1,2)+d(2,2)
댓글 수: 0
채택된 답변
KSSV
2021년 9월 22일
x = 0 ; y = 0 ;
a = 0.2;
b = 0.3;
while ~(x == 1 && y == 1)
c = rand ;
d = rand ;
m = [a c; b d];
d=normc(m);
x = d(1,1)+d(2,1)
y = d(1,2)+d(2,2)
end
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!