how to input a function output's in another one?

Hi,
I am having trouble putting my variables created in a function script as inputs of another function. Can somebody help me please?

답변 (1개)

Walter Roberson
Walter Roberson 2022년 12월 30일
%example
[out1, out2] = first_function(12345)
x2 = 8
x1 = 169
out1 = 169
out2 = 8
out3 = second_function(out1, out2)
x3 = 28569
out3 = 28569
function [x1, x2] = first_function(n)
x2 = mod(n, 73)
x1 = (n-x2)/73
end
function x3 = second_function(x1, x2)
x3 = x1.^2 + x2
end

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2022년 12월 30일

답변:

2022년 12월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by