How to make a 0.001 difference ?

Hey All,
I am a novice in matlab. Have a basic doubt
I know how to make a difference say
1:1:100
But how to make a difference to every number add up with another 0.001
Example
[1 1+0.001 2 2+0.001 3 3+0.001 4 4+0.001 5 5+0.001]
As you can see, the 0.001 is not added to every number number the alternative number.
How to do this ? Plz help me

 채택된 답변

Ivan van der Kroon
Ivan van der Kroon 2011년 5월 31일

0 개 추천

a=1:100;
b=sort([a a+0.001]);

댓글 수: 2

Oleg Komarov
Oleg Komarov 2011년 5월 31일
b = [a; a+.001];
b = b(:).';
Fire
Fire 2011년 5월 31일
Thank you Guyssssss.. seems to work

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터 및 File Exchange에서 Operating on Diagonal Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by