Question

# Q2. One school is evaluating the running (100m) speed of grade 9 students. The speeds are...

Q2. One school is evaluating the running (100m) speed of grade 9 students. The speeds are recorded in a vector T. The speed is categorized as “normal” if the time is less than 17s and more than 13s; The speed is categorized as “fast” if the speed is less than or equal to 13s; The speed is categorized as “slow” if the speed is more than or equal to 17s. Code to create a string vector D to record the speed results corresponding to the values in vector T. For example, T = [15, 14, 18, 12.5, ...], then D= [“normal”, “normal”, “slow”, “fast”…]

I need help to solve this in MATLAB programming...please

In the below program i have used cell string to fulfill this requirement.

I have also verified its output and it is giving expected result.

We can add as many variable in the vector as required as it is already dynamic in nature.

T = [15, 14, 18, 12.5]
D1={'slow','fast','normal'}
D = []
for a = T
if a >= 17
D(length(D)+1)=1
elseif a <= 13
D(length(D)+1)=2
else
D(length(D)+1)=3
end
result = char(D1(D))
disp(result)
end

###########################################

op-

```normal
normal
slow
fast  ```

#### Earn Coins

Coins can be redeemed for fabulous gifts.