Use a vectorized method to obtain the results as a vector, not as a bunch of single variables:
w = 0:0.001:1.393;
k = 2;
tao = 2;
T = tan((tao * w - k * pi) / 2) ./ w;
Then min and max can be applied directly:
Result = [min(T), max(T)];
Alternatively with a less efficient loop:
w = 0:0.001:1.393;
k = 2;
tao = 2;
T = zeros(1, numel(w));
for iw = 1:numel(w)
T(iw) = tan((tao * w(iw) - k * pi) / 2) / w(iw);
end
Then the above command to obtain the result is working also.
1 Comment
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/716003-min-and-max-value-of-many-results#comment_1261993
Direct link to this comment
https://es.mathworks.com/matlabcentral/answers/716003-min-and-max-value-of-many-results#comment_1261993
Sign in to comment.