I want to make some program which required input from user. I want to make the program works this way
for example if user input : x = [1 1 1; 0 1 1; 0 0 0; 1 1 0;] then matlab will automatically change it into x = [1 1 1; -1 1 1; -1 -1 -1; 1 1 -1;] before processing it to some formula

 채택된 답변

David Fletcher
David Fletcher 2021년 5월 10일

0 개 추천

x = [1 1 1; 0 1 1; 0 0 0; 1 1 0;]
x(x==0)=-1

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by