how to right matlab code

8 次查看(过去 30 天)
devendra
devendra 2015-3-12
编辑: devendra 2015-3-23
clear all; close all;
%%%%%%%ensemble_avg calculating form this method. ensemble_avg = o;
for i = 1:5
if i == 1;
load model_1_data.mat;
ensemble = model_1;
elseif i == 2;
load model_2_data.mat;
ensemble = model_2;
elseif i == 3;
load model_3_data.mat;
ensemble = model_3;
elseif i == 4;
load model_4_data.mat;
ensemble = model_4;
elseif i == 5;
load model_5_data.mat;
ensemble = model_5;
end
ensemble_avg = ensemble_avg + ensemble;
ensemble_avg = ensemble_avg/5;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
natural_variability = 0.4595;
m_r_b = 0;
m_r = 0;
m = 1 ; n = 1; % for this calculation taking m = 1 and n = 1
for i = 1:5
if i == 1;
load observation.mat;
load model_1_data.mat;
bias = model_1 - obs;
elseif i == 2;
load model_2_data.mat;
bias = model_2 - obs;
elseif i == 3;
load model_3_data.mat;
bias = model_3 - obs;
elseif i == 4;
load model_4_data.mat;
bias = model_4 - obs;
elseif i == 5;
load model_5_data.mat;
bias = model_5 - obs;
end
distance = bias - ensemble_avg;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
model_reli = (((natural_variability/abs(bias)).^m).*((natural_variability/abs(distance)).^n));
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
m_r_b = m_e_e + (model_reli.*bias); % model reliability and model bias
m_r = m_e + model_reli;
weigh_avg_ens = m_e_e/m_e; % rea method (average change)
end
this is code for this attached file . this right or wrong and pls help me how will be repeat procedure for equation 3rd and 4th
  3 个评论
Sara Hafeez
Sara Hafeez 2015-3-12
They are basic summation and division equations with a power or exponent of n you can easily do them if you know basic maths
devendra
devendra 2015-3-12
i have already written code for these equation but i want to crosscheck that my code is right or wrong but thank you so much for your nice comment. this time i am at home i will also attached my code tomorrow when i will in lab.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by