I am trying to laod a file from my school resources for an assignment but I cant access it afterwards. This is the message I get from matlab:
>> matinfoblig21c
t =
[]
v =
[]
mydata =
data: [1219x1 double]
textdata: {1219x1 cell}
rowheaders: {1219x1 cell}
This is the script I am using:
t=[]
v=[]
mydata=importdata('running.txt')
I need to load the two columns of the file into two vectors so that I can access them in a for loop. How can I do that? he file is attached. Thanks!

댓글 수: 4

Walter Roberson
Walter Roberson 2015년 11월 5일
The file did not get attached.
The information you displays would be consistent with the possibility that your file consists of pairs of values for each line, with the first value on the line being text and the second value being numeric.
torgny
torgny 2015년 11월 5일
편집: torgny 2015년 11월 5일
I think I did get it uploaded now. The first column is time the other is velocity and they both have numerical values. Thanks!
When I use those commands on the data file you provided, mydata comes out as a 1219 x 2 matrix, just as you would expect.
Please use
which -all importdata
You should see something similar to toolbox/matlab/iofun/importdata.m under your MATLAB installation. If you see multiple lines then the first of them is probably something in your own directories that is interfering with loading the data properly.
torgny
torgny 2015년 11월 5일
편집: torgny 2015년 11월 5일
Thanks I did get it done!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

질문:

2015년 11월 5일

편집:

2015년 11월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by