Skip to content

Commit f209689

Browse files
pradeebanCopilot
andauthored
Update concore_initval.m
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7db41e4 commit f209689

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

concore_initval.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
clean_str = strtrim(simtime_val);
55
clean_str = regexprep(clean_str, '[\[\]]', '');
66
result = sscanf(clean_str, '%f').';
7+
% Guard against empty or invalid numeric input
8+
if isempty(result)
9+
concore.simtime = 0;
10+
result = [];
11+
return;
12+
end
713
concore.simtime = result(1);
8-
result = result(2:length(result));
14+
if numel(result) >= 2
15+
result = result(2:end);
16+
else
17+
result = [];
18+
end
919
end

0 commit comments

Comments
 (0)