フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

For loop counter and External function

1 回表示 (過去 30 日間)
Darren
Darren 2013 年 12 月 8 日
閉鎖済み: Darren 2013 年 12 月 8 日
Let's say my script begins with
-------------------------
a=input("Key in value: ")
For k=1:10
y=externalfunction(a)
end
--------------------
And my function
function[y]=externalfunction(a)
a=10+a
end
The error pops out because the counter k is not defined in the function. So how can I define it in the function so I can use it in the script? Please don't tell me it's unnecessary to use an external function. It's actually necessary and this is just an analogy to my far more complex question.

回答 (0 件)

この質問は閉じられています。

Community Treasure Hunt

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

Start Hunting!

Translated by