hi , i'm trying to make a simple loop which is give me a useless syntax between what i need , please how can i remove ('ans=') thanks anyway

2 次查看(过去 30 天)
for k=1:20
sprintf('<div> DIV %d </div>',k)
end
it gives :
ans =
<div> DIV 18 </div>
ans =
<div> DIV 19 </div>
ans =
<div> DIV 20 </div>

采纳的回答

Ameer Hamza
Ameer Hamza 2020-9-21
Use fprintf()
for k=1:20
fprintf('<div> DIV %d </div>\n',k)
end

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by