10x10 Matrix
조회 수: 20 (최근 30일)
이전 댓글 표시
Create a 10x10 matrix with random numbers between 0 and 10. Now, make all elements in the first row
and first column equal to 1.
댓글 수: 0
답변 (2개)
David Fletcher
2021년 4월 18일
a=ones(10);
a(2:end,2:end)=randi([0 10],9)
댓글 수: 3
Image Analyst
2025년 4월 12일
@AFARIEBOR, exactly what does that mean? A matrix is just an array of numbers. Exactly what does "solve" mean to you? Explain it in a new question, after you read this: TUTORIAL: How to ask a question (on Answers) and get a fast answer
To learn other fundamental concepts, invest 2 hours of your time here:
Image Analyst
2025년 4월 13일
Alternatively (since you already have a solution to your homework problem from the other Answer) you can do
m = 10 * rand(10); % Floating point/fractional numbers between 0 and 10
m(1,:) = 1; % Set first (top) row to all 1's.
m(:, 1) = 1 % Set first (left) column to all 1's
To learn other fundamental concepts, invest 2 hours of your time here:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!