필터 지우기
필터 지우기

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 CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by