Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Function output in another function?

3 Ansichten (letzte 30 Tage)
Steve
Steve am 10 Okt. 2011
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hello Experts,
For example I have:
function t = test(a)
in this function I use another function test2 but I need all the output of test2: [out1,out2] = test2;
How can I do this, because it doesn't work for me in this way.
Thanks a lot in advance.

Antworten (1)

Fangjun Jiang
Fangjun Jiang am 10 Okt. 2011
In test2.m
function [out1,out2]=test2;
out1=1;
out2=2;
In test.m
function t=test(a)
[out1,out2]=test2;
t=a+out1+out2;
In Command Window, run
test(0)

Diese Frage ist geschlossen.

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by