answersLogoWhite

0

First, make sure your vector is initialized outside of the loop. Then, within your loop you need to update the vector. If you want data entered by the user only, you should initialize with an empty vector.

Example program (not sure which loop you're using, but I'll use a while loop here):

vector=[];

user='y';

while user=='y'

user=input('Enter another variable? Type y for yes and n for no: ');

if user=='n'

break

end

var=input('Please input variable: ');

vector=[vector, var];

end

The key part in this coding is the line:

>> vector=[vector,var];

as this will update your vector with the previous vector values, and then add another value to the vector with whatever number var is.

Hope this helps!

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

How do you modulate in matlab without using matlab tools?

You would have to write your own code for a modulation (Matlab has a convolution function not in the tools), otherwise you can use its built in function in the signal processing toolbox.


Which of these references a velocity (not speed)?

I would say vector


What universities use MATLAB?

I would hope most have an institution license.


Could this ever be the rule of a function For input x the output is the number whose square is x If so what is its domain and range?

Yes, the domain(input) would be all natural numbers (numbers greater or equal to zero). The range (output) would be all real numbers. -- Not only natural numbers would be considered part of this domain, all negative numbers are also reasonable inputs to this function, as any negative number multiplied by itself would produce a positive number..... The output (range) would therefore be all positive real numbers......


What is the column vector?

In mathematics a vector is just a one-dimensional series of numbers. If the vector is written horizontally then it is a row vector; if it's written vertically then it's a column vector.Whether a vector is a row or a column becomes significant usually only if it is to figure in multiplication involving a matrix. A matrix of m rows with n columns, M, can multiply a column vector, c, of m rows, on the left but not on the right.That is, one can perform Mv but not vM. The opposite would be true for a row vector, v, with 1 row and m columns.


A force has a magnitude of 10 newtons what other information is needed to have a complete description of its properties as a force?

No other information is needed if the force is a scalar force. Only if one believes that force is only a vector then one would need the direction information. However, it is a wrong to believe that force is only a vector. Force in general is a quaternion. A quaternion can be a scalar or a vector, thus a force can be a scalar or a vector or both. But it is cleaner to think of scalar forces as being in a single direction. Thus the direction of force is implicit, not that it does not matter. A.k.a. a scalar force is a force with an implicit direction while a vector force is a force with an explicit direction. It is cleaner to consider a scalar force as having a direction angle of a multiple of 180 degrees and a vector force having a direction angle a multiple of 90 degrees. Any other angle would be give a scalar and vector, or a quaternion. This is similar to complex numbers, there are real numbers, imaginary numbers and complex numbers. Reals and complex numbers are subsets of quaternions.


Why a unit vector is aone type of vector but a vector is not a unit vector?

A unit vector is a vector whose magnitude is one. Vectors can have magnitudes that are bigger or smaller than one so they would not be unit vectors.


Why is it impossible to add a scalar to a vector?

Scalars are single numbers, while vectors have both magnitude and direction. Adding a scalar to a vector would change the vector's magnitude but not its direction, leading to a different type of mathematical operation. It is not possible to directly add a scalar to a vector in the same way you would add two vectors of the same dimension.


How would you define the zero vector 0?

The zero vector, denoted as 0, is a vector with all components equal to zero. It serves as the additive identity element in vector spaces, meaning that adding it to any vector does not change the vector's value.


For Indian rupees its paisa what is it for pounds?

This would be a monetary conversion. You can find these kinds of converters online and then just input the numbers that you want.


What are the Examples of a vector quantity?

Some examples of a vector quantity would be a car or a plane.


Is direction a vector?

"North" is a valid direction, but for a vector, you would also need a magnitude.