How can I use a fonction result in a new script.
1 次查看(过去 30 天)
显示 更早的评论
After run a function I get ans = ... on the command window. I wish to declare the result of mi function as a variable to use it in a new scrip. It's that possible?
Thanks
0 个评论
回答(1 个)
Nishitha Ayyalapu
2013-10-17
doc function
Example
function result = Addition(X,Y)
result = X+Y;
end
Now in any other script you can just do
Z = Addition(2,3);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multidimensional Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!