Create a vector variable vec; it can have any length. Then, write assignment statements that would store the first half of the vector in one variable and the second half in another
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:2| Question number:47.2
All Answers
total answers (1)
>> vec = 1:9;
>> fhalf = vec(1:fix(length(vec)/2))
fhalf =
1 2 3 4
>> shalf = vec(fix(length(vec)/2)+1:end)
shalf =
5 6 7 8 9
need an explanation for this answer? contact us directly to get an explanation for this answer