I don't usually post to on here, but I can't seem to figure this one out. I have some code where I use a structure to store important information. Some of these are vectors/arrays and others are character arrays. Below are some snippets from my code:
I have 25 geophysical lines, so the first thing I do is initialize the structure:
geoLineStruct(1:25,1) = struct('LineName',' ','sSoL',zeros(1,2),'sEoL',zeros(1,2),...
'rSoL',zeros(1,2),'rEoL',zeros(1,2),'dType',0,'resOffset',0, 'sLength',0.0, ...
'rLength',0.0,'topoFileLoc',' ','seisDataLoc', ' ', 'resDataLoc', ' ');
Then I simply fill the structure one by one with my required information, this is information I would normally have to type in over and over again
geoLineStruct(1,1).LineName = 'BW-051713';
geoLineStruct(1,1).sSoL = [467161 4559433];
geoLineStruct(1,1).sEoL = [467256 4559272];
geoLineStruct(1,1).dType = 1;
geoLineStruct(1,1).resOffset = 0;
geoLineStruct(1,1).sLength = 190;
geoLineStruct(1,1).rLength = 165;
.
.
.
This is were the problem gets weird! I get an parse error if I try to reassign one of the values of the structure to another variable, but this only happens in the script! For example:
temp = geoLineStruct(1,1).sSoL
I get a little red squiggly under the ")" with an error that says, "Parse error at ')': usage may be invalid MATLAB syntax.
This exact command perfect if I type it (or copy it) into the command window.
>> temp = geoLineStruct(1,1).sSoL
temp =
467161 4559433
This code was working just fine last week, and I got this error, when I tried to run it this morning. Does any one know why I am getting a parse error, i.e. Matlab thinking this is a logical? Or a way to tell Matlab to ignore it?