I have a script that opens a folder and does some processing on the data present. Say, there's a file "XYZ.tif".
Inside this tif file, there are two groups of datasets, which show up in the workspace as
data.ch1eXYZ
and
data.ch3eXYZ
If I want to continue with the 2nd set, I can use A=data.ch3eXYZ
However, XYZ usually is much longer and varies per file, whereas data.ch3e is consistent.
Therefore I tried A=strcat('data.ch3e','origfilename'); where origfilename of course is XYZ, which has (automatically) been extracted before.
However, that gives me a string A (since I practically typed
A='data.ch3eXYZ'
instead of the matrix that data.ch3eXYZ actually is. I think it's just a problem with ()'s, []'s, or {}'s but Ican't seem to figure it out.
Thanks in advance!
evalin this case. Tryeval(['A = ' strcat('data.ch3e','origfilename') ';'])evalyou probably should be doing things differently so that you don't need it. In this case, maybe use cells instead of fields. Oh, I see now that @excaza's answer solves it with dynamic field names. Clever