Q:

Write code that will prompt the user for 4 numbers, and store them in a vector. Make sure that you preallocate the vector!

0

 Write code that will prompt the user for 4 numbers, and store them in a vector. Make sure that you preallocate the vector! 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

vec = zeros(1,4);

for i = 1:4

 vec(i) = input('Enter a number: ');

end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now