필터 지우기
필터 지우기

Random Numbers Generation for Changing Ranges

조회 수: 1 (최근 30일)
New User
New User 2020년 10월 24일
답변: Freewing 2020년 10월 24일
How can I create a matrix of a size 50 x 50 in MATLAB and each column vector of matrix i.e., 50 x 1 size must have random numbers within a given range and then range for the next column vectors must decrement by k until last column vector is reached?

답변 (1개)

Freewing
Freewing 2020년 10월 24일
rand(50,50) will give you a matrix or random numbers between 0 and 1. Multiply it by row vector of ranges to get each column have the range corresponding to the value in row vector, e.g. rand(50,50).*(50:-1:1)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by