importing data and plotting

1 Ansicht (letzte 30 Tage)
Joseph
Joseph am 3 Mär. 2015
Kommentiert: Joseph am 3 Mär. 2015
Hello, I'm importing a large text file and trying to plot the values over time. but every time i go to plot the data I get the error: 'vectors must be the same lengths' the data is very large and I want to plot it over 5 seconds. i named the imported data s2. Please help. thanks
t = 0:.01:5
plot(t,s2)

Akzeptierte Antwort

rantunes
rantunes am 3 Mär. 2015
Hey,
your file s2 has only one column? Try to make length(s2). It should be the same as length(t).
Greets
  5 Kommentare
rantunes
rantunes am 3 Mär. 2015
What do you mean "not connected"?
For sure if you want to plot something in a given interval, the points of this interval have to have a correspondence to the values of the function. And Matlab works on that basis. Let's put in other terms: you cant plot vectors of different sizes, and we have to live with it!
Joseph
Joseph am 3 Mär. 2015
thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by