Effacer les filtres
Effacer les filtres

Function内の変数を保存する方法について

45 vues (au cours des 30 derniers jours)
Hiroyasu Fujita
Hiroyasu Fujita le 12 Fév 2021
Modifié(e) : Musashi Ito le 15 Fév 2021
funtion 内の変数をワークスペースに出力したいのですが、やり方がわからないためやり方をご存知の方がいればご教示願います。
x , y , z , xx , yyをワークペースに出力したい
**************************************
global x
global y
global z
global xx
global yy
test(1,2,3)
function test(x,y,z)
x
y
z
x+y+z
test2(4,2)
end
function test2(xx,yy)
xx
yy
xx-yy
end

Réponses (1)

Musashi Ito
Musashi Ito le 15 Fév 2021
Modifié(e) : Musashi Ito le 15 Fév 2021
関数の function キーワードの後に出力変数を定義すると、ワークスペースの変数に代入できます。以下の関数の基礎も参考にして頂くと良いと思います。

Catégories

En savoir plus sur 動的システム モデル dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!