开发者

Attempt to reference field of non-structure array

Can anyone tell me why the following code

function s3()

   function ret = fun(x)
       disp(x);
       ret = 0;
   end

  fun(1);

end

produces "Attempt to reference field of non-structure array.". I have t开发者_运维问答his code in a file called s3.m. If I run this in the editor using the play button it runs fine. If I enter s3.m on the command line it produces the above error. Thanks for any help in advance!


Call it this way:

s3()

rather than

s3.m

because it's a function you have created.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜