How should I use erfc?

2 ビュー (過去 30 日間)
인범 황
인범 황 2021 年 10 月 4 日
回答済み: Walter Roberson 2021 年 10 月 4 日
The equation in the photo is the analytic solution of the ED model(equilibrium-dispersive model).
We want to express the expression of the photo in MATLAB.
Shouldn't variables be used in erfc?
Please tell me how to use erfc
The variables are x and t.
c(x,t)
Please tell me how to put it in matlab.
  1 件のコメント
Rik
Rik 2021 年 10 月 4 日
What did you try so far?
Have a read here and here. It will greatly improve your chances of getting an answer.

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

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 10 月 4 日
When you use simulink, generally speaking each time you call a function other than the basic mathematical operators, you should assign the result to a variable. The variable should have already been assigned zeros() that is the same size as the result you expect from the function call.
t1 = zeros(1,1);
t2 = zeros(1,1);
t3a = zeros(1,1);
t3b = zeros(1,1);
t4 = zeros(1,1);
t5a = zeros(1,1);
t5b = zeros(1,1);
t1 = sqrt(P_e/2);
t2 = L./u .* (1 + a.*F);
t3a = t2 .* x - t;
t3b = t2 .* x + t;
t4 = sqrt(t2 .* t);
t5a = erfc(t1 .* t3a ./ t4);
t5b = erfc(t1 .* t3b ./ t4);
and so on.
Not all of the above temporary variables are required: some of them exist only to make it easier to write both erfc() sub-expressions

カテゴリ

Help Center および File ExchangePartial Differential Equation Toolbox についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by