Skip to content

Commit 4f04b9b

Browse files
committed
tighten Excel writing code in matlab
1 parent a2aaa47 commit 4f04b9b

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

matlab_expo_2022/demo_openpyxl.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
for P = pets
4545
row = row + 1;
4646
for j = 1:length(category)
47-
nextCell = sheet.cell(row,col+j);
48-
nextCell.value = P{1}{j};
47+
sheet.cell(row,col+j,P{1}{j});
4948
if j == 3 && P{1}{j} < 0.1
5049
nextCell = sheet.cell(row,col+j);
5150
nextCell.font = ft_red;

matlab_expo_2022/demo_openpyxl_2020b.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@
4646
for P = pets
4747
row = row + 1;
4848
for j = 1:length(category)
49-
nextCell = sheet.cell(row,col+j);
50-
nextCell.value = P{1}{j};
49+
sheet.cell(row,col+j,P{1}{j});
5150
if j == 3 && P{1}{j} < 0.1
5251
nextCell = sheet.cell(row,col+j);
5352
nextCell.font = ft_red;

matlab_expo_2022/imp.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
function [module] = imp(module_name)
22
% Abbreviaiton for py.importlib.import_module(module_name)
3-
module = py.importlib.import_module(module_name)
3+
module = py.importlib.import_module(module_name);
44
end

0 commit comments

Comments
 (0)