diff --git a/Untitled.m b/Untitled.m index cccd39a..f6907fe 100644 --- a/Untitled.m +++ b/Untitled.m @@ -38,7 +38,8 @@ n = struct(); %% function element = updateDamping(element) - for field = fieldnames(element.k) - element.c.(field{1}) = 1/element.ksi.(field{1})*sqrt(element.k.(field{1})/element.m); + field = fieldnames(element.k); + for i = 1:length(field) + element.c.(field{i}) = 1/element.ksi.(field{i})*sqrt(element.k.(field{i})/element.m); end end