Info
此问题已关闭。 请重新打开它进行编辑或回答。
where is the error ?
1 次查看(过去 30 天)
显示 更早的评论
function [ vmin ] = mini(vect)
%MINI retourne le minimum d’un vecteur
n = numel(vect);
if n == 0
vmin = [];
else
vmin = vect(1);
for k = 2:n
if vect(k) < vmin
vmin = vect(k);
end
end
end
end
function [ vmax ] = maxi(vect)
%MAXI retourne le maxiimum d’un vecteur
n = numel(vect);
if n == 0
vmax = [];
else
vmax = vect(1);
for k = 2:n
if vect(k) > vmax
vmax = vect(k);
end
end
end
end
8 个评论
Walter Roberson
2018-12-2
defining the variable in the base workspace is not enough .you need to go to the command line and
mini(v)
此问题已关闭。
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!