forked from cjlin1/liblinear
/
load_dat.m
39 lines (29 loc) · 840 Bytes
/
load_dat.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
%% Import data from text file
% Script for importing data from the following text file:
%
% filename: /Users/girasole/liblinear/my_output.txt
%
% Auto-generated by MATLAB on 13-Jan-2021 00:25:00
%% Setup the Import Options and import the data
opts = delimitedTextImportOptions("NumVariables", 1);
% Specify range and delimiter
opts.DataLines = [1, Inf];
opts.Delimiter = ",";
% Specify column names and types
opts.VariableNames = "VarName2";
opts.VariableTypes = "double";
% Specify file level properties
opts.ExtraColumnsRule = "ignore";
opts.EmptyLineRule = "read";
% Import the data
tbl = readtable("/Users/girasole/liblinear/my_output.txt", opts);
%% Convert to output type
freqs = tbl.VarName2;
%% Clear temporary variables
clear opts tbl
%%
n = 1000;
B = 1/n*ones(n,1);
out = filter(B,1,freqs);
figure(1);clf;
plot(out);