Answer:
Matlab code with step by step explanation and output results are given below
Step-by-step explanation:
We have to construct a Matlab function that creates a row vector "countValues" with elements 1 to endValue. That means it starts from 1 and ends at the value provided by the user (endValue).
function countValues = CreateArray(endValue)
% Here we construct a row vector countValues from 1:endValue
countValues = 1:endValue;
% then we transpose this row vector into column vector
countValues = countValues';
end
Output:
Calling this function with the endValue=11 returns following output
CreateArray(11)
ans =
1
2
3
4
5
6
7
8
9
10
11
Hence the function works correctly. It creates a row vector then transposes it and makes it a column vector.