: Create a function that takes inputs “x” and “z” and generates any random matrix of dimension “x” or “z”, whichever is larger

조회 수: 4 (최근 30일)
Hi, I am stuck at this problem. I don't know alot about generating matrices. Help would be greatly appreicated.
  댓글 수: 3
Image Analyst
Image Analyst 2020년 1월 31일
Also look up what max() returns, like max([x, z]) assuming x and z are scalars (single numbers, not arrays).
Gurinder Punni
Gurinder Punni 2020년 1월 31일
I don't have any constraints so I can probably make then up.
So I should do something like this
f(x,z) = x*z
x = randi(0,100)
z= randi(0,100)
if x > z
matrix = [ x ]
else if z>x
matrix = [z]
end
idk, just some thoughts.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Random Number Generation에 대해 자세히 알아보기

제품


릴리스

R2006a

Community Treasure Hunt

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

Start Hunting!

Translated by