Spatio Temporal Aquarium
Sunday, June 05, 2005
  Matlab Problem: setappdata and structure arrays

It turns out my old code is not as messy as I thought. There are lots of comments, and it is relatively logically structured. I have decided to just modify the old code.

So, I try and run it. And it crashes on the Initialise routine.

For some reason, the code that used to work, no longer works. That's OK. It is what I expected.

However, I have spent the last hour trying to figure out why it doesn't work, and I am stuck. I think it should work. I think the documentation says it should work, but the documentation is not very explicit.

The problem is on the setappdata function:
setappdata(STVFig,'dataset.isosurf.M',[]);
It doesn't like the fields (ie "isosurf" and "M"). It is quite happy if I just do this:
setappdata(STVFig, 'dataset',[]);

But I don't want to do just that. I want dataset to be a structure array like this:

dataset
- isosurf
- M
- O
- isopatch
- M
- O

I can't figure out how to define the dataset structure in the setappdata function. Usually, you can just add a field like this:
dataset.isosurf.M = [];

I have tried setting up the fields, and then using that in the setappdata function, eg:
dataset.isosurf.M =1;
dataset.isosurf.O = 2;
setappdata(STVFig,'dataset',dataset);
but that doesn't seem to be working either.

I think I need more coffee. I really want chocolate, but I know if I go home, I won't come back.

Technorati Tags: , , , , ,

 

Comments: Post a Comment

<< Home
My thesis blog. Matlab. GIS. Visualization. Spatio-temporal. Time Geography. Aquarium.

Recent Posts

Archives
June 2005 / July 2005 / August 2005 /


Powered by Blogger