ill2000m
Electrical
- Oct 7, 2003
- 7
x =' hskd';
X = sort(x);
[U I J] = unique(X);
N = diff([0 I]);
bar(N)
set(gca,'XtickLabel',U.')
[num2str(N.') U.']
the code above will allow me to sort out the frequency of the charcher
appear in x .
e.g the result is 1h 1s 1k 1d
now i want to import a text file from the directory
'C:\MATLAB6p5\work\test.txt' and the content of test.txt is hskd.
i wish to to use the same program to sort out the frequecny for each
character but when i try to use the fuction importdata it wouldnt work
...... does anyone know how to do it ..
this is the m file i written
x =importdata('C:\MATLAB6p5\work\test.txt')
X = sort(x);
[U I J] = unique(X);
N = diff([0 I]);
bar(N)
set(gca,'XtickLabel',U.')
[num2str(N.') U.']
X = sort(x);
[U I J] = unique(X);
N = diff([0 I]);
bar(N)
set(gca,'XtickLabel',U.')
[num2str(N.') U.']
the code above will allow me to sort out the frequency of the charcher
appear in x .
e.g the result is 1h 1s 1k 1d
now i want to import a text file from the directory
'C:\MATLAB6p5\work\test.txt' and the content of test.txt is hskd.
i wish to to use the same program to sort out the frequecny for each
character but when i try to use the fuction importdata it wouldnt work
...... does anyone know how to do it ..
this is the m file i written
x =importdata('C:\MATLAB6p5\work\test.txt')
X = sort(x);
[U I J] = unique(X);
N = diff([0 I]);
bar(N)
set(gca,'XtickLabel',U.')
[num2str(N.') U.']