MATLAB Answers

0

need solution of exercice

Asked by KHAIF HICHEM on 8 Dec 2018
Latest activity Commented on by Walter Roberson
on 10 Dec 2018

  10 Comments

First exercise involves calculating the sum of two matrices, and the product of two matrices. if, while and for must be used in the code.
Second exercise involves recursive calculation of maximum and minimum of two vectors.)
and in the second exercise i have trying this
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
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
but the same problem can't resolve
what problem are you observing ?

Sign in to comment.

1 Answer

Answer by KHAIF HICHEM on 9 Dec 2018

Please i need solution

  0 Comments

Sign in to comment.