MATLAB: How to read and take a part of data of a text file in MATLAB

text filetext;textscan

Dear everyone,
Please help me to solve this problem. I need to make a code that can read data from a text file. The format of the file is as follows:
0.1 ABC63-820
0.5 ABC63-818
1.0 ABC63-813
I want to take out two variables like this:
X=[0.1 0.5 1.0];
Y=[20 18 13]
Can anyone help me to write a code to take out these data?
Thank you so much!

Best Answer

Dear Phan,
textscan can do the job:
>> fid=fopen(filename);
>> data=textscan(fid,'%f ABC63-8%d');
>> fclose(fid);
>> x=data{1};y=data{2};
Best regards,
Michael