How to create an array like this? with dot after the number

4 views (last 30 days)
Hi, Can anyone tell me how can I create an array like this in matlab? 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.
thank you very much!

Accepted Answer

Oleg Komarov
Oleg Komarov on 15 May 2012
You can create such an array just as a string:
sprintf('%.f. ',ones(10,1))

More Answers (1)

Walter Roberson
Walter Roberson on 15 May 2012
There is no numeric difference between that and the array without the dot.
Is the dot for display purposes? If so then what is it being displayed to ?

Categories

Find more on Operators and Elementary Operations in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!