substitute a symbol instead of zeros in a matrix
조회 수: 5 (최근 30일)
이전 댓글 표시
i have matrix a=[3 5 0;2 0 5;1 0 0] now i want to replace all zeros with any symbols. for example i need output as a=[3 5 *;2 * 5;1 * *]
댓글 수: 0
답변 (1개)
Walter Roberson
2016년 4월 4일
That cannot be done in a numeric array. You can create a string with that content or you can display to the screen (or file) in the form you want, or you can create a cell array of strings that have '*' in those positions -- but you cannot create a numeric array like that.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!