From 1157ba5f101b3292b088fb2c12a40c75cd16f82a Mon Sep 17 00:00:00 2001 From: August Johansson Date: Thu, 25 Apr 2024 15:30:39 +0200 Subject: [PATCH] Fix bug: make sure the right object is used in the switch --- Electrochemistry/FullSolidDiffusionModel.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Electrochemistry/FullSolidDiffusionModel.m b/Electrochemistry/FullSolidDiffusionModel.m index f11efa7f..69010ce9 100644 --- a/Electrochemistry/FullSolidDiffusionModel.m +++ b/Electrochemistry/FullSolidDiffusionModel.m @@ -52,12 +52,12 @@ D = inputparams.diffusionCoefficient; if ~isempty(D) - switch inputparams.D.type + switch D.type case 'constant' model.useDFunc = false; case 'function' model.useDFunc = true; - model.computeDFunc = str2func(inputparams.D.functionname); + model.computeDFunc = str2func(D.functionname); otherwise errror('type of D not recognized.') end