From: nordmoon on
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
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...

--