how to right matlab code

조회 수: 2 (최근 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