Write a script with commands to create the following vectors

Write a script with commands to create the following vectors and assign to the indicated variable names. Create an evenly-spaced row vector A with elements starting at 0 and ending at 50 with increments of 0.5. Create a row vector B with 80 evenly-spaced elements starting at 0 and ending at pi/2. Create a row vector C that is an integer data type with elements counting backward in increments of 5 from 200 to 0.

Solution

>> A=[0:0.5:50];
>> A

A =

Columns 1 through 16

         0    0.5000    1.0000    1.5000    2.0000    2.5000    3.0000    3.5000    4.0000    4.5000    5.0000    5.5000    6.0000    6.5000    7.0000    7.5000

Columns 17 through 32

    8.0000    8.5000    9.0000    9.5000   10.0000   10.5000   11.0000   11.5000   12.0000   12.5000   13.0000   13.5000   14.0000   14.5000   15.0000   15.5000

Columns 33 through 48

   16.0000   16.5000   17.0000   17.5000   18.0000   18.5000   19.0000   19.5000   20.0000   20.5000   21.0000   21.5000   22.0000   22.5000   23.0000   23.5000

Columns 49 through 64

   24.0000   24.5000   25.0000   25.5000   26.0000   26.5000   27.0000   27.5000   28.0000   28.5000   29.0000   29.5000   30.0000   30.5000   31.0000   31.5000

Columns 65 through 80

   32.0000   32.5000   33.0000   33.5000   34.0000   34.5000   35.0000   35.5000   36.0000   36.5000   37.0000   37.5000   38.0000   38.5000   39.0000   39.5000

Columns 81 through 96

   40.0000   40.5000   41.0000   41.5000   42.0000   42.5000   43.0000   43.5000   44.0000   44.5000   45.0000   45.5000   46.0000   46.5000   47.0000   47.5000

Columns 97 through 101

   48.0000   48.5000   49.0000   49.5000   50.0000

>> B=linspace(0,pi/2,80);
>> B

B =

Columns 1 through 16

         0    0.0199    0.0398    0.0597    0.0795    0.0994    0.1193    0.1392    0.1591    0.1790    0.1988    0.2187    0.2386    0.2585    0.2784    0.2983

Columns 17 through 32

    0.3181    0.3380    0.3579    0.3778    0.3977    0.4176    0.4374    0.4573    0.4772    0.4971    0.5170    0.5369    0.5567    0.5766    0.5965    0.6164

Columns 33 through 48

    0.6363    0.6562    0.6760    0.6959    0.7158    0.7357    0.7556    0.7755    0.7953    0.8152    0.8351    0.8550    0.8749    0.8948    0.9146    0.9345

Columns 49 through 64

    0.9544    0.9743    0.9942    1.0141    1.0339    1.0538    1.0737    1.0936    1.1135    1.1334    1.1532    1.1731    1.1930    1.2129    1.2328    1.2527

Columns 65 through 80

    1.2725    1.2924    1.3123    1.3322    1.3521    1.3720    1.3918    1.4117    1.4316    1.4515    1.4714    1.4913    1.5111    1.5310    1.5509    1.5708

>> C=[200:-5:0];
>> C

C =

Columns 1 through 27

   200   195   190   185   180   175   170   165   160   155   150   145   140   135   130   125   120   115   110   105   100    95    90    85    80    75    70

Columns 28 through 41

    65    60    55    50    45    40    35    30    25    20    15    10     5     0

 Write a script with commands to create the following vectors and assign to the indicated variable names. Create an evenly-spaced row vector A with elements sta
 Write a script with commands to create the following vectors and assign to the indicated variable names. Create an evenly-spaced row vector A with elements sta

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site