How should I use erfc?

2 vues (au cours des 30 derniers jours)
인범 황
인범 황 le 4 Oct 2021
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 commentaire
Rik
Rik le 4 Oct 2021
What did you try so far?
Have a read here and here. It will greatly improve your chances of getting an answer.

Connectez-vous pour commenter.

Réponses (1)

Walter Roberson
Walter Roberson le 4 Oct 2021
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

Catégories

En savoir plus sur Partial Differential Equation Toolbox dans Help Center et File Exchange

Tags

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by