linspace是在用matlab時很常用到的指令,主要功能在製造出一組等距的向量。舉例來說,若要在-10~10之間產生100個等距的數字,就可以用這個指令。

L=linspace(-10,10) 

linspace.PNG

若沒有特別指令的話linspace就會產生100個等距的數字。如果不想產生那麼多數字,舉例來說若要在-10~10之間產生5個等距的數字,就可以在linspace後面加上指令

L = linspace(-10,10,5)

5個數字.PNG

 

arrow
arrow
    創作者介紹
    創作者 Worldexplorer 的頭像
    Worldexplorer

    worldexplorer

    Worldexplorer 發表在 痞客邦 留言(0) 人氣()