write a script that does the following.
이전 댓글 표시
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
Matt Fig
2012년 12월 1일
Are you giving me an assignment? Sounds like it!
Actually it sounds like a homework problem that was given to you, and you are trying to pass on to someone else.
Show what you have done so far, and ask a question if you are stuck.
Walter Roberson
2012년 12월 3일
You do not appear to define any "x" to run a scatter plot on.
kevin piaget
2012년 12월 4일
Walter Roberson
2012년 12월 4일
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.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!