Error using sprintf command
Mostra commenti meno recenti
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 Commenti
KSSV
il 21 Set 2021
Use fprintf.
The error is clear, SUMSED is not defined.
Walter Roberson
il 21 Set 2021
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
il 21 Set 2021
Modificato: Walter Roberson
il 21 Set 2021
Walter Roberson
il 21 Set 2021
You do not assign to SUMSED anywhere in that code.
However, your variable Q appears to be a total (sum) of sed values.
KSSV
il 21 Set 2021
It seems Q is SUMSED.
Image Analyst
il 21 Set 2021
Why are you not using the sum(), cumsum(), and diff() functions to do this?
Nitesh Kumar Singh
il 22 Set 2021
Risposte (0)
Categorie
Scopri di più su Image Arithmetic in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!