how to run the main program contain two call statement that call the function statement

2 ビュー (過去 30 日間)
Arvind Sharma
Arvind Sharma 2017 年 10 月 18 日
回答済み: Cam Salzberger 2017 年 10 月 18 日
here is the program code all constant parameter defined
for
muhh(k)=mu(mhh,ncarrier(k),kelvin,rerr); %Call mu chemical potential function for holes
mue(k) =mu(me, ncarrier(k),kelvin,rerr); %Call mu chemical potential function for electrons
for
fhh=fermi(beta,Ehh,muhh(k)); %Call Fermi function for holes
fe=fermi(beta,Ee,mue(k));%Call Fermi function for electrons
end
end
figure plot
ist calling function
function [mu]=mu(emass,ncarrier,kelvin,rerr)
statement defined
return
other 2nd calling function (also used by ist function [mu]=mu(emass,ncarrier,kelvin,rerr))
function [fermi]=fermi(beta,energy,mu1)
statement defined
return
how to run the main program using this function
  2 件のコメント
Stephen23
Stephen23 2017 年 10 月 18 日
編集済み: Stephen23 2017 年 10 月 18 日
Just call or run the main function. What happens when you try doing that?
Arvind Sharma
Arvind Sharma 2017 年 10 月 18 日
little error shows i have sort it out .parse error syntax error

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

回答 (1 件)

Cam Salzberger
Cam Salzberger 2017 年 10 月 18 日
Hello Arvind,
If your code literally has this line:
for
Then that could very well be the cause of the syntax error. Did you mean something more like:
for k = 1:numel(ncarrier)
Similarly for:
figure plot
Did you mean something more like:
figure
plot(muhh, mue)
Also note that "fhh" and "fe" will be changing each loop iteration, but don't seem to be used. Did you mean to index them?
If that's not the issue, can you post the exact error text?
-Cam

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by