Mercurial > repos > public > sbplib
view operator_def/read_stencil.m @ 826:b94bb6ffa38b feature/operator_files
rename d2_2 to D1_standard_2
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Mon, 10 Sep 2018 17:48:48 +0200 |
parents | 95c26000c0ba |
children |
line wrap: on
line source
function [stencil_variables] = read_stencil(stencil) fileID = fopen(stencil,'r'); line = fgetl(fileID); while ~feof(fileID) if isempty(line) elseif strcmp(line(1),'#') else varname = genvarname(line); val = []; line = fgetl(fileID); while ~isempty(str2num(line)) val = [val; str2num(line)]; line = fgets(fileID); if line == -1 break end end stencil_variables.(varname) = val; end line = fgetl(fileID); end end