Avoid +0 when using fprintf %+d
Mostra commenti meno recenti
Consider the code
names={'aba','cda','efa','fea','pod'};
numbers=randi([-1 1],5,4);
for i=1:5
fprintf('|%s|%+d|%+d|%+d|%+d|\n',names{i},numbers(i,:))
end
whose output is similar to
|aba|+0|+1|+1|+1|
|cda|-1|+1|-1|+1|
|efa|+1|+0|-1|-1|
|fea|+1|+0|-1|+1|
|pod|+1|-1|-1|-1|
Is there a way to remove the plus in front of the 0s, or to not print + when the number is 0?
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Genomics and Next Generation Sequencing 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!