-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSTART.m
More file actions
51 lines (40 loc) · 1.61 KB
/
Copy pathSTART.m
File metadata and controls
51 lines (40 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
function [ ] = START( )
%% Nunatak ice-thinning model
%% Written by Ángel Rodés -- SUERC
% angelrodes@gmail.com
% 2021
%% Ask what to do
btn = questdlg ('Select', 'NUNAIT calculator', 'Run simulation', 'Display results', 'Run simulation');
%% remove previous plots
close all hidden
if strcmp(btn,'Run simulation')
%% Input data
% [file,path] = uigetfile({'*.csv','*.CSV','*.mat','*.MAT'}, 'Select input file or production rates');
[file,path] = uigetfile({'*.*'}, 'Select input file (csv) or production rates (mat)');
selectedfile = fullfile(path,file);
[filedir, filename, fileext] = fileparts (selectedfile);
if ~strcmp(fileext,'.mat') && ~strcmp(fileext,'.MAT')
input_sample_data(selectedfile); % load data and calculate production rates
newfile=fullfile(filedir,[filename '_sampledata.mat']); % name of the file generated by input_sample_data
selectedfile=newfile;
else
load(selectedfile) % load data and production rates
end
%% Fit model
disp(['Fitting: ' selectedfile ''])
plot_samples(selectedfile); % run model
fit_nuna_model(selectedfile); % run model
[filedir, filename, fileext] = fileparts (selectedfile);
selectedfile=fullfile(filedir,[filename '_model.mat']);
else
[file,path] = uigetfile({'*model.mat','*model.MAT'}, 'Select output file');
selectedfile = fullfile(path,file);
disp(['File: ' selectedfile])
end
%% Display results
display_results(selectedfile);
plot_results(selectedfile);
% Uncomment for extra plots
% plot_individual_profiles(selectedfile);
% plot_landscape_evolution(selectedfile);
end