Please help me understand what happens to the matrices bellow
古いコメントを表示
Hi All
I have a matrix t [3 1000]
and then these lines :
y00 = repmat( mean(t,2), 1, size(t,2))
MSE00 = mse( t - y00 )
MSE00 = mean(var(t',1))
nperf = mse(t-y)/MSE00
what does each line do ??
4 件のコメント
dpb
2015 年 3 月 15 日
I suggest making up a small sample array (say 3x5) and try each step at the command line and observe, using the documentation to aid your exploration...you'll learn a lot more and retain what you learn much better that way.
farzad
2015 年 3 月 15 日
Roger Stafford
2015 年 3 月 15 日
The line "repmat( mean(t,2), 1, size(t,2))" first takes the mean value of each of the three rows of matrix 't', giving a 3-by-1 column vector as a result. Then the 'repmat' operator repeats this vector along the second dimension so that it is again of size 3-by-1000. Each of its thousand columns will then be the same.
dpb
2015 年 3 月 15 日
NB: that bsxfun will allow writing the following lines w/o the explicit expansion, too...highly recommended as long as the version in use incorporates it (which is getting to be quite some time ago now altho I don't recall just when that was).
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Variables についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!