Create new matrix based on grid location
古いコメントを表示
Suppose I have matrix A:
A=[4 1 0.6;4 1 0.8; 1 4 0.5; 1 3 0.3; 3 2 0.1; 2 1 0.6; 2 4 0.5; 3 2 0.4; 1 1 0.3; 1 2 0.1]
Now, I want to find the mean value in the last column matrix A above and then created in the new matrix. So I want to generate the new matrix A as:
A =
0.6000 0 0 0
0 0.2500 0 0
0.6000 0 0 0.5000
0.3000 0.1000 0 0
Anyone, can help me? I've tried looping and if command, but i always get errors
2 件のコメント
Jan
2021 年 2 月 13 日
Please post your code and a copy of the complete error message.
I do not see, how the output of the 4x4 matrix can be obtained based on the 10x3 input matrix and a "mean of the last column".
eko supriyadi
2021 年 2 月 13 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!