Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试从另一个函数访问一个函数的输出。我有以下功能:
function f = doSomething f = 5+6;
在另一个函数中,我调用 doSomething 如下:
doSomething;
有没有办法获得价值f?我想读取 doSomething 的输出并显示它。
f
写
输出 = doSomething();
将结果存储到变量“输出”,和
fprintf('%d\n',输出);
显示它。