Creating a linearly spaced array of a particular size

后端 未结 2 1486
生来不讨喜
生来不讨喜 2021-01-28 14:47

I am new to MATLAB and currently working on my homework assignment. I am trying to declare the x variable as the following:

Create a linearl

2条回答
  •  没有蜡笔的小新
    2021-01-28 15:37

    You can use linspace as follow:

    x = linspace(-pi, pi, 200);
    

    check this out for an example: https://www.mathworks.com/help/matlab/ref/linspace.html

提交回复
热议问题