matlab学者,MATLAB 最新的意大利学者TommasoBelluzzo-SystemicRisk-2b4ebd0程序分享

warning('off','all');

spmd

warning('off','all')

end

close('all');

clearvars();

clc();

delete(allchild(0));

[path_base,~,~] = fileparts(mfilename('fullpath'));

if (~strcmpi(path_base(end),filesep()))

path_base = [path_base filesep()];

end

if (~isempty(regexpi(path_base,'Editor')))

path_base_fs = dir(path_base);

is_live = ~all(cellfun(@isempty,regexpi({path_base_fs.name},'LiveEditorEvaluationHelper')));

if (is_live)

pwd_current = pwd();

if (~strcmpi(pwd_current(end),filesep()))

pwd_current = [pwd_current filesep()];

end

while (true)

answer = inputdlg('It looks like the program is being executed in a non-standard mode. Please, confirm or change the root folder of this package:','Manual Input Required',1,{pwd_current});

if (isempty(answer))

return;

end

path_base_new = answer{:};

if (isempty(path_base_new) || strcmp(path_base_new,path_base) || strcmp(path_base_new(1:end-1),path_base) || ~exist(path_base_new,'dir'))

continue;

end

path_base = path_base_new;

break;

end

end

end

if (~strcmpi(path_base(end),filesep()))

path_base = [path_base filesep()];

end

paths_base = genpath(path_base);

paths_base = strsplit(paths_base,';');

for i = numel(paths_base):-1:1

path_current = paths_base{i};

if (~strcmp(path_current,path_base) && isempty(regexpi(path_current,[filesep() 'Scripts'])))

paths_base(i) = [];

end

end

paths_base = [strjoin(paths_base,';') ';'];

addpath(paths_base);

dataset = fullfile(path_base,['Datasets' filesep() 'Example_Large.xlsx']);

data = parse_dataset(dataset);

out_temp_stochastic = fullfile(path_base,['Templates' filesep() 'TemplateStochastic.xlsx']);

out_file_stochastic = fullfile(path_base,['Results' filesep() 'ResultsStochastic.xlsx']);

result_stochastic = run_stochastic(data,out_temp_stochastic,out_file_stochastic,0.95,0.40,0.08,0.40,true);

mat_stochastic = fullfile(path_base,['Results' filesep() 'DataStochastic.mat']);

save(mat_stochastic,'result_stochastic');

pause(2);

out_temp_connectedness = fullfile(path_base,['Templates' filesep() 'TemplateConnectedness.xlsx']);

out_file_connectedness = fullfile(path_base,['Results' filesep() 'ResultsConnectedness.xlsx']);

result_connectedness = run_connectedness(data,out_temp_connectedness,out_file_connectedness,252,0.05,true,0.06,true);

mat_connectedness = fullfile(path_base,['Results' filesep() 'DataConnectedness.mat']);

save(mat_connectedness,'result_connectedness');

pause(2);

out_temp_spillover = fullfile(path_base,['Templates' filesep() 'TemplateSpillover.xlsx']);

out_file_spillover = fullfile(path_base,['Results' filesep() 'ResultsSpillover.xlsx']);

result_spillover = run_spillover(data,out_temp_spillover,out_file_spillover,252,2,4,true,true);

mat_spillover = fullfile(path_base,['Results' filesep() 'DataSpillover.mat']);

save(mat_spillover,'result_spillover');

mat_dataset = fullfile(path_base,['Results' filesep() 'Dataset.mat']);

save(mat_dataset,'data');

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值