Hi everyone,
I am trying to get the value of the first element of an output of a function. For example, The output of my function test is [a1, a2, a3] and I want to get the value of a1 only.
The way I do it is
a = test(input);
result = a(1);
I wonder if there is an easier way to do it. Is there something similar to
result = (test(input))(1);
in matlab?
1 Comment
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/38732-getting-first-element-of-a-function-output#comment_938672
Direct link to this comment
https://in.mathworks.com/matlabcentral/answers/38732-getting-first-element-of-a-function-output#comment_938672
Sign in to comment.