フィルターのクリア

How to calculate values at the nodal points?

3 ビュー (過去 30 日間)
revathy M
revathy M 2017 年 9 月 27 日
回答済み: AM 2020 年 3 月 26 日
hi!
Need to evaluate certain values at every nodal point. Have discretized then have used for loop to do calculation. Not getting any error but there is a variation in the result. My need is the value of P1,P2 ..... etc must be evaluated at each point. Do x_bar(j) represent the value of x_bar at the j th position (like x_bar(1)=0,x_bar(1)=0.01etc).
Xb = [0, .5, 1.25, 1.50];
delx_bar = [.01, .005, .0001];
x_bar = cumsum([Xb(1), repelem(delx_bar,diff(Xb)./delx_bar)]);
del_eta=0.02;
eta_inf=4;
n_xbar=length(x_bar);
eta=(0:del_eta:eta_inf).';
n_eta=length(eta);
for j=2:n_xbar-1
for i=2:n_eta
P1(j) = 1 - cos(x_bar(j));
P2(j) = 1 + cos(x_bar(j));
end
end
  2 件のコメント
Walter Roberson
Walter Roberson 2017 年 9 月 27 日
What is the purpose of your "for i=2:n_eta" loop? You do not use "i" inside the loop.
revathy M
revathy M 2017 年 9 月 30 日
Have just given the part of the code.i runs over the row and j runs over the column.

サインインしてコメントする。

採用された回答

KSSV
KSSV 2017 年 9 月 28 日
Xb = [0, .5, 1.25, 1.50];
delx_bar = [.01, .005, .0001];
x_bar = cumsum([Xb(1), repelem(delx_bar,diff(Xb)./delx_bar)]);
del_eta=0.02;
eta_inf=4;
n_xbar=length(x_bar);
eta=(0:del_eta:eta_inf).';
n_eta=length(eta);
P1 = zeros([],[]) ;
P2 = zeros([],[]) ;
for j=2:n_xbar-1
for i=2:n_eta
P1(i,j) = 1 - cos(x_bar(j));
P2(i,j) = 1 + cos(x_bar(j));
end
end

その他の回答 (1 件)

AM
AM 2020 年 3 月 26 日
Hi, I need a help for my diploma work, can anyone help me to write my matlab code, it's so important.

カテゴリ

Help Center および File ExchangeClocks and Timers についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by