10x10 Matrix
17 ビュー (過去 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!