write a script that does the following.

3 vues (au cours des 30 derniers jours)
kevin piaget
kevin piaget le 1 Déc 2012
a) Asks user for the length of the vector
b) Ask user to input elements of the vector ( do it in a loop using info about the length and check that inputs are numbers)
c) Graph the vector as a scatter plot
this what i did:
a=input('lenght of the vector')
for b=1:a
c(b)=input('input the value')
end
as it comes t graph the vector as a plot i don't understand how to do it.
from my search i try to this
scatter(x)
and i have an error message
i want t o know if the for loop is well used in order to ask for the input of the elements of the vector
  4 commentaires
kevin piaget
kevin piaget le 4 Déc 2012
its ratter scatter(c) but it returs me an error message
Walter Roberson
Walter Roberson le 4 Déc 2012
It makes it easier for volunteers if you indicate what the message is.
Probably the message has to do with not providing enough arguments to scatter() since it requires at least two arguments, x and y coordinates. You do not have two coordinates, however, so you cannot create meaningful output. You could create random coordinates for that matter.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by