How to make a sequence number?

2 次查看(过去 30 天)
Hello,
i have a number 6, i wann get it to the sequence number. it's like an example with randperm(6), but i want it to sequence not randperm, so the result should be 1 2 3 4 5 6.
How can i do this? please help me.thanks in advance

采纳的回答

James Tursa
James Tursa 2013-5-23
n = 6;
sequence = 1:n;

更多回答(1 个)

David Sanchez
David Sanchez 2013-5-23
n=6;
my_seq=linspace(1,n,n)
my_seq =
1 2 3 4 5 6

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by