Skip to content

Commit f35b2c9

Browse files
committed
small bugfixes and readme update
1 parent cc75243 commit f35b2c9

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

LICENSE.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
Copyright (c) 2016-2020, ETH Zurich, Power Electronic Systems Laboratory, T. Guillod
2+
Copyright (c) 2021-2022, T. Guillod
23

34
Redistribution and use in source and binary forms, with or without
45
modification, are permitted provided that the following conditions are met:

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,4 @@ The tool is tested with the following MATLAB setup:
4646

4747
* This project is licensed under the **BSD License**, see [LICENSE.md](LICENSE.md).
4848
* This project is copyrighted by: (c) 2016-2020, ETH Zurich, Power Electronic Systems Laboratory, T. Guillod.
49+
* This project is copyrighted by: (c) 2021-2022, T. Guillod.

data/data_parsed.mat

-3.64 KB
Binary file not shown.

utils/get_parse.m

+15-9
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
% filter and sort
3232
[res, n_sol] = filter_sort(res, n_sol, filter, sort);
33+
assert(n_sol>0, 'invalid data')
3334

3435
% get the color scale
3536
color = get_color(res, n_sol, color_axis);
@@ -39,6 +40,7 @@
3940

4041
% parsed the variable
4142
var = get_var(res, n_sol, var_axis);
43+
assert(length(var_axis)>1, 'invalid data')
4244

4345
% display the parsed data
4446
disp_data_parsed(highlight, var)
@@ -137,7 +139,7 @@
137139
fct = highlight_tmp.fct;
138140
name = highlight_tmp.name;
139141
color = highlight_tmp.color;
140-
142+
141143
idx_vec(i) = fct(res, n_sol);
142144
color_vec{i} = color;
143145
name_vec{i} = name;
@@ -206,11 +208,13 @@ function disp_data_parsed(highlight, var)
206208
% var (struct): parsed variables data
207209

208210
% highlighted lines
209-
fprintf('highlight\n')
210-
fprintf(' n_highlight = %d\n', highlight.n_highlight)
211-
fprintf(' highlight\n')
212-
for i=1:highlight.n_highlight
213-
fprintf(' %s = %s / %d\n', highlight.name_vec{i}, highlight.color_vec{i}, highlight.idx_vec(i))
211+
if highlight.n_highlight>0
212+
fprintf('highlight\n')
213+
fprintf(' n_highlight = %d\n', highlight.n_highlight)
214+
fprintf(' highlight\n')
215+
for i=1:highlight.n_highlight
216+
fprintf(' %s = %s / %d\n', highlight.name_vec{i}, highlight.color_vec{i}, highlight.idx_vec(i))
217+
end
214218
end
215219

216220
% variable number
@@ -233,9 +237,11 @@ function disp_data_parsed(highlight, var)
233237
fprintf(' min_max = [%.3f, %.3f]\n', min(vec), max(vec))
234238

235239
% highlighted line values
236-
fprintf(' highlight\n')
237-
for j=1:highlight.n_highlight
238-
fprintf(' %s = %.3f\n', highlight.name_vec{j}, vec(highlight.idx_vec(j)))
240+
if highlight.n_highlight>0
241+
fprintf(' highlight\n')
242+
for j=1:highlight.n_highlight
243+
fprintf(' %s = %.3f\n', highlight.name_vec{j}, vec(highlight.idx_vec(j)))
244+
end
239245
end
240246
end
241247

0 commit comments

Comments
 (0)