MATLABで、2~3個、引数を関数につけて、コマンドウィンドーで走らせるには?
19 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
いちいち、
A=5
B=3
C=-4
とかして、
Functionを走らせるのが
面倒です。
C言語のように、
Function(A,B,C)とかには、できないのでしょうか?
それと、parforですが、forと具体的に、どう違うかわからないのと、
tic()
と
Pressure[];
と言う行を見つけたのですが、これはどういうことでしょうか?
ど素人ですみません。
0 commentaires
Réponses (1)
Kazuya
le 11 Avr 2019
Function(A,B,C)とかには、できないのでしょうか?
についてはできます。A, B, Cを入力にとる関数を定義してください。例:
function output = myfun(A,B,C)
output = A+B+C;
end
を myfun.m という名前で保存してもらえれば、
myfun(A,B,C)
と実行できます。
parfor は Parallel Computing Toolbox が入っていれば、for ループを並列実行します。tic や他のコマンドについては
doc tic
と実行してドキュメンテーションページを確認してみてください。
0 commentaires
Voir également
Catégories
En savoir plus sur ループと条件付きステートメント dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!