Originally Posted by
Mathhelpz yea,
this is my script so far
% initialize the vector
VEC = [];
n = 1;
VEC_length = input('Please type a value that is > 9 and < 21:');
if VEC_length < 10 || VEC_length > 21
error('Incorrect Input... Quitting!')
end
Vec1 = input('Type in a value for the first element:')
% Add first element to the vector
VEC(n)=Vec1;
% Use a for loop to add more number to the vector
for i=1:VEC_length
n=n+1;
VEC(n)= Vec1 +i;
end
I don't really know what to do on step 4? COuld you help me
This is wrong:
Code:
VEC_length = input('Please type a value that is > 9 and < 21:');
if VEC_length < 10 || VEC_length > 21
error('Incorrect Input... Quitting!')
end
Try inputting a value of 21
CB