Hi Guys,
I am trying generate a magic square using MATLAB using the following code:
clear
n=input('give input:');
if rem(n,2)~=0
M=odd_magic(n)
elseif rem(n,4)~=0
M=single_even_magic(n)
else
M=double_even_magic(n)
end
I am getting an error called -
Undefined function or method 'double_even_magic' for input arguments of type 'double'.
Kindly help me out in this regard and suggest answers. Thank you.

댓글 수: 2

Andreas Goser
Andreas Goser 2012년 2월 8일
Is that: Command line code, a function or a script?
Abhishek
Abhishek 2012년 2월 8일
It is a script.

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2012년 2월 8일

0 개 추천

You do not define odd_magic, single_even_magic, or double_even_magic. I don't think any of those are built-in functions.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Programming에 대해 자세히 알아보기

질문:

2012년 2월 8일

편집:

2013년 10월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by