採用された回答

Image Analyst
Image Analyst 2017 年 12 月 6 日

0 投票

No need for for loops, especially ones that don't work. Simply use ones:
B = p * ones(327,245,2, 'uint8');

1 件のコメント

Image Analyst
Image Analyst 2017 年 12 月 6 日
Try this:
p=uint8(0);
for L = 3 : -1 : 1
for row = 327 : -1 : 1
for col = 245 : -1 : 1
B(row, col, L)=p;
end
end
end
It's a very inefficient way of doing it. I reverse the indexes to try to make it more efficient though. You should NOT want to do it this way.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Resizing and Reshaping Matrices についてさらに検索

質問済み:

2017 年 12 月 6 日

編集済み:

2017 年 12 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by