フィルターのクリア

why it does not work ?

1 回表示 (過去 30 日間)
EZRA
EZRA 2023 年 10 月 29 日
コメント済み: Voss 2023 年 10 月 29 日
function out = block3(row, colomn)
a = zeros(row, colomn);
for i = 1:row
for j = 1:colomn
if ~mod(i,2) && ~mod(j,2)
a(i, j) = 1;
end
end
  1 件のコメント
Voss
Voss 2023 年 10 月 29 日
You ask why it does not work. In order to answer that question, we need to know what it should do, but you haven't told us that. What should this function do?

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

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 10 月 29 日
  • missing end statement
  • no assignment to the output variable out
  3 件のコメント
EZRA
EZRA 2023 年 10 月 29 日
function block3(row, colomn)
a = zeros(row, colomn);
for i = 1:row
for j = 1:colomn
if ~mod(i,2) && ~mod(j,2)
a(i, j) = 1;
end
end
end
Voss
Voss 2023 年 10 月 29 日
Wild guess: Perhaps the function should output the variable 'a'.

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

カテゴリ

Help Center および File ExchangeLanguage Fundamentals についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by