필터 지우기
필터 지우기

if i want to change each value 1 in a matrix to 0 how to do that?

조회 수: 1 (최근 30일)
mary
mary 2013년 12월 4일
댓글: mary 2013년 12월 7일
a=[1 2 3;1 3 3;2 1 2]
is there a function that make a as below
b=[0 2 3;0 3 3;2 0 2]
  댓글 수: 2
José-Luis
José-Luis 2013년 12월 4일
Is this homework?
This can be solved with a combination of loops (for) and conditional statements (if), or in a syntactically simpler way with logical indexing.
mary
mary 2013년 12월 4일
nop i just want a function some reduced thing instead of using loops

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

채택된 답변

José-Luis
José-Luis 2013년 12월 4일
b = a;
b(b==1) = 0;
  댓글 수: 3
José-Luis
José-Luis 2013년 12월 4일
Please accept an answer if it helped you.
mary
mary 2013년 12월 7일
sure i just forgot ,, sorry ,, thanx again

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by