Prev: using fmincon with high dimension optimization
Next: error compiling s-function for rtw xpc device driver
From: nordmoon on 13 Nov 2009 23:30 How does textscan work? I have tried to read in a vector from a text file and save it into vector to be used in my program but I only get something like this when I try to access the variable I am saving it into. [124x1 single] This is how I use the code: filterfileB1 = 'something.txt'; fidB1 = fopen(filterfileB1); filterB1 = textscan(fidB1, '%f32 %f32') fclose(fidB1); How can I access the vector that I upload? Am I doing something wrong? I don't understand, I am doing as the examples? Help please?
From: dpb on 14 Nov 2009 10:17
nordmoon wrote: > How does textscan work? I have tried to read in a vector from a > textfile and save it into vector to be used in my program but I only > get something like this when I try to access the variable I am saving > it into. > > [124x1 single] > > This is how I use the code: > > filterfileB1 = 'something.txt'; > > fidB1 = fopen(filterfileB1); > filterB1 = textscan(fidB1, '%f32 %f32') > fclose(fidB1); > > How can I access the vector that I upload? .... textscan() returns a cell array. You need to dereference it to see the contents. Use the curly brackets instead of parens... disp{filterB1} for example. Other than that would need sample of data file to comment... -- |