I am learning to use matlab. In the following code I want to apply the mldivide function https://www.mathworks.com/help/matlab/ref/mldivide.html However, I am a little confused on how a function handles outputs. According to the documentation https://www.mathworks.com/help/matlab/ref/function.html when I call my function in the command window I should have out1, out2, and out3 spat out to me. But only out1 is displayed. Why?
function [out1, out2, out3] = testSystem(in1, in2, in3)
b = [in1; in2; in3];
A = [2, 1, 1;
-1, 1, -1;
1, 2, 3;];
x = A\b;
disp(x);
out1 = x(1,1);
out2 = x(2,1);
out3 = x(3,1);
end
>> testSystem(2,3,-10)
3
1
-5
ans =
3