Thread Subject: error"Attempt to reference field of non-structure array"

Subject: error"Attempt to reference field of non-structure array"

From: lichao qi

Date: 5 Jun, 2008 00:53:03

Message: 1 of 7

when i open a finished gui .fig file with the guide,it is
ok.However the error happen once i double click it.do
anybody know why?

Subject: error

From: Erik

Date: 5 Jun, 2008 01:54:03

Message: 2 of 7

"lichao qi" <qilichao1106@126.com> wrote in message
<g27ddf$2gn$1@fred.mathworks.com>...
> when i open a finished gui .fig file with the guide,it is
> ok.However the error happen once i double click it.do
> anybody know why?

Can you elaborate a bit? What are you clicking on? The
figure background? Maybe attach some code as well. I wish I
could read minds, but I can't.

Subject: error

From: Image Analyst

Date: 5 Jun, 2008 03:38:02

Message: 3 of 7

"Erik " <emiehling@gmail.com> wrote in message
<g27gvr$7pq$1@fred.mathworks.com>...
> "lichao qi" <qilichao1106@126.com> wrote in message
> <g27ddf$2gn$1@fred.mathworks.com>...
> > when i open a finished gui .fig file with the guide,it
is
> > ok.However the error happen once i double click it.do
> > anybody know why?
>
> Can you elaborate a bit? What are you clicking on? The
> figure background? Maybe attach some code as well. I wish
I
> could read minds, but I can't.

------------------------------------------------------------
Erik:
Well then you just need to purchase the "Mind Reading
Toolkit." It's been recently updated for R2008a. There's
a nifty function called "GenerateAnswer()" that's
especially designed for newgroup postings. It's called
like this:
GenerateAnswer('Help');
GenerateAnswer('Help me');
GenerateAnswer('Please help');
GenerateAnswer('Please Help Me');
GenerateAnswer('i need help!!!');
GenerateAnswer('Help us?!!');
GenerateAnswer('matlab');
GenerateAnswer('MATLAB help');
GenerateAnswer('error');
GenerateAnswer('matlab error');
GenerateAnswer('Urgent help needed');
GenerateAnswer('Why doesn't this work?');
GenerateAnswer('HELP GUI');
GenerateAnswer('big problem');
GenerateAnswer('newbie question');
GenerateAnswer('a dare');
GenerateAnswer('tricky');
GenerateAnswer('anyone can help me');
GenerateAnswer('im also having problems');
GenerateAnswer('How can I do this using matlab');
GenerateAnswer('simple GUI question');
GenerateAnswer('sos');
GenerateAnswer('help needed!!!!');
GenerateAnswer('ERROR MESSAGE');
GenerateAnswer('[no subject]');
GenerateAnswer('hi');
GenerateAnswer('test');
GenerateAnswer('cheap Nike air Jordan');
GenerateAnswer('discount shoes');
and my personal favorite:
GenerateAnswer('Urgent help needed -
pleeeeeeeeeeeze!!!!!!!');
just to mention a few recent actual postings plus a few of
our recurring favorites. There are also some new functions
used thus:
   sarcasticmode on (or off)
   bozofilter on (or off)
   let_Walter_Answer()
   punt_to_John()
   ask_Lord_for_help()
and a gag/joke function
   run_marcos_code()
which simulates a crash of your computer.

I've been using it and it's worth the $1000 purchase
price. How do the other users like it? Any functions that
the toolikt is missing and we should request for the next
release?

Regards,
ImageAnalyst

Subject: error

From: lichao qi

Date: 5 Jun, 2008 08:18:01

Message: 4 of 7

"Erik " <emiehling@gmail.com> wrote in message
<g27gvr$7pq$1@fred.mathworks.com>...
> "lichao qi" <qilichao1106@126.com> wrote in message
> <g27ddf$2gn$1@fred.mathworks.com>...
> > when i open a finished gui .fig file with the guide,it
is
> > ok.However the error happen once i double click it.do
> > anybody know why?
>
> Can you elaborate a bit? What are you clicking on? The
> figure background? Maybe attach some code as well. I wish
I
> could read minds, but I can't.
thank you for your attention ,i think i did not make it
clear.i mean error happens when i double click the figure
file.Actually i have solved the problem.while programing ,i
used the command line "set
(handle.out,'string','output')"(handle.out is a handle
corresponding to a Edit Text)in the opening function,and it
worked well.then i used the global varible "handles.out" in
a callback funtion ,for i thought the varible had been
defined.NO!it was not .so the error mentioned above
happened.Everything is all right after i defined the
varible handle.out with command line"handle.out=hObject" in
the out_CreatFcn funtion.

Subject: error"Attempt to reference field of non-structure array"

From: Steven Lord

Date: 5 Jun, 2008 13:54:27

Message: 5 of 7


"lichao qi" <qilichao1106@126.com> wrote in message
news:g27ddf$2gn$1@fred.mathworks.com...
> when i open a finished gui .fig file with the guide,it is
> ok.However the error happen once i double click it.do
> anybody know why?

There are two pieces to a GUI generated by GUIDE -- the FIG-file and the
M-file. You should run your GUI by running the M-file -- it does some setup
then opens the FIG-file. When you open the FIG-file directly by
double-clicking on it in the Current Directory browser (which is where I
assume you double-clicked it) you open the FIG-file without doing the
M-file's setup first, and I'm pretty sure that's what causes the error you
described.

--
Steve Lord
slord@mathworks.com


Subject: error"Attempt to reference field of non-structure array"

From: guj

Date: 30 Jul, 2009 08:55:10

Message: 6 of 7

"Steven Lord" <slord@mathworks.com> wrote in message <g28r6k$b3o$1@fred.mathworks.com>...
>
> "lichao qi" <qilichao1106@126.com> wrote in message
> news:g27ddf$2gn$1@fred.mathworks.com...
> > when i open a finished gui .fig file with the guide,it is
> > ok.However the error happen once i double click it.do
> > anybody know why?
>
> There are two pieces to a GUI generated by GUIDE -- the FIG-file and the
> M-file. You should run your GUI by running the M-file -- it does some setup
> then opens the FIG-file. When you open the FIG-file directly by
> double-clicking on it in the Current Directory browser (which is where I
> assume you double-clicked it) you open the FIG-file without doing the
> M-file's setup first, and I'm pretty sure that's what causes the error you
> described.
>
> --
> Steve Lord
> slord@mathworks.com
>
>


Attempt to reference field of non-structure array !
I always get this error and some time it gone by itself. Yesterday one i was calling a funtion it was giving me error on some line. What this error means can some explain it in a simple maner

Subject: error"Attempt to reference field of non-structure array"

From: Steven Lord

Date: 30 Jul, 2009 13:18:23

Message: 7 of 7


"guj " <gulatiakshay@gmail.com> wrote in message
news:h4rn5e$6jk$1@fred.mathworks.com...
> "Steven Lord" <slord@mathworks.com> wrote in message
> <g28r6k$b3o$1@fred.mathworks.com>...
>>
>> "lichao qi" <qilichao1106@126.com> wrote in message
>> news:g27ddf$2gn$1@fred.mathworks.com...
>> > when i open a finished gui .fig file with the guide,it is
>> > ok.However the error happen once i double click it.do
>> > anybody know why?
>>
>> There are two pieces to a GUI generated by GUIDE -- the FIG-file and the
>> M-file. You should run your GUI by running the M-file -- it does some
>> setup
>> then opens the FIG-file. When you open the FIG-file directly by
>> double-clicking on it in the Current Directory browser (which is where I
>> assume you double-clicked it) you open the FIG-file without doing the
>> M-file's setup first, and I'm pretty sure that's what causes the error
>> you
>> described.
>>
>> --
>> Steve Lord
>> slord@mathworks.com
>>
>>
>
>
> Attempt to reference field of non-structure array !
> I always get this error and some time it gone by itself. Yesterday one i
> was calling a funtion it was giving me error on some line. What this error
> means can some explain it in a simple maner

The short version is that you're taking a variable that is not a struct
array:

x = 1:10;

and trying to ask for a field of that variable, which doesn't work because
regular numeric arrays don't have fields.

y = x.structFieldIndexingWillError

To determine why you receive this error, run your code using the debugging
tools provided in the Editor. If you open up the Help Browser (using the
DOC function) and navigate to the Desktop Tools and Development Environment
item under the MATLAB item in the tree, one of the items should be "Editing
and Debugging M-Files". Read through that to learn how to debug your code
and locate the cause of this error.

--
Steve Lord
slord@mathworks.com

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com