댓글 수: 10

Adam Danz
Adam Danz 2018년 12월 8일
I (unfortunately) don't speak the language in the text. But even if I did speak that language, there's no way I would put more time into the answer than the time put into making the question.
At the very least, type out the question so people can read it and be specific about the help you need.
Walter Roberson
Walter Roberson 2018년 12월 8일
(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.)
Walter Roberson
Walter Roberson 2018년 12월 8일
KHAIF HICHEM
KHAIF HICHEM 2018년 12월 9일
yes , its about
"(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.)"
But i need the solution of there (the script to do this exercise)
madhan ravi
madhan ravi 2018년 12월 9일
What have you tried so far?
sir please this is home work
i have trying this
the sum:
for i = 1:n
for j = 1:m
C(i,j) = A(i,j) + B(i,j);
end
end
and in the multi :
for i = 1:n
for j = 1:n
x = 0
for k = 1:n
x = x + A(i,k)*B(k,j);
end
C(i,j) = x
end
end
but i dont now where is ther problem in this
madhan ravi
madhan ravi 2018년 12월 9일
Translate the photo in English as a text
KHAIF HICHEM
KHAIF HICHEM 2018년 12월 9일
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.)
KHAIF HICHEM
KHAIF HICHEM 2018년 12월 9일
편집: madhan ravi 2018년 12월 9일
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
Walter Roberson
Walter Roberson 2018년 12월 10일
what problem are you observing ?

댓글을 달려면 로그인하십시오.

답변 (1개)

Moussa Attati
Moussa Attati 2022년 10월 21일
편집: DGM 2024년 1월 1일

0 개 추천

function y = ProductFun(a,b)
m = size(a,1) ; % Column
n = size(b,2) ; % Rows
if size(a,2)==size(b,1)
y = zeros(n,m);
for i = 1 : m
for j = 1 : n
y(i,j)= a(i,:)*b(:,j) ;
end
end
else
disp(' The matrice do not have the same size ')
end
end

댓글 수: 1

Moussa Attati
Moussa Attati 2022년 10월 21일
편집: DGM 2024년 1월 1일
function y = SumFun(a,b)
k = size(a,1) ; % Line
j = size(a,2) ; % Column
if size(a) == size(b)
y = zeros(k,j) ;
for i = 1 : k
for u = 1 : j
y(i,u) = a(i,u)*b(i,u) ;
end
end
else
disp(' The matrice do not have the same size ')
end
end

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2018년 12월 8일

편집:

DGM
2024년 1월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by