Error using sprintf command
이전 댓글 표시
sprintf('Iteration: %d, Sum: %d, difference: %d',a, SUMSED(a,1), diff_(a,1))
The system cannot find the path specified.
Unrecognized function or variable 'SUMSED'.
댓글 수: 7
KSSV
2021년 9월 21일
Use fprintf.
The error is clear, SUMSED is not defined.
Walter Roberson
2021년 9월 21일
sprintf() is fine in this context.
If you have any "if" statements, then it possible that none of them came out true. That can especially happen if you accidentally test an entire vector instead of one element of the vector.
Nitesh Kumar Singh
2021년 9월 21일
편집: Walter Roberson
2021년 9월 21일
Walter Roberson
2021년 9월 21일
You do not assign to SUMSED anywhere in that code.
However, your variable Q appears to be a total (sum) of sed values.
KSSV
2021년 9월 21일
It seems Q is SUMSED.
Image Analyst
2021년 9월 21일
Why are you not using the sum(), cumsum(), and diff() functions to do this?
Nitesh Kumar Singh
2021년 9월 22일
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Image Arithmetic에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!