Hi,
It has been hours that I'm struggling and still …no way to solve it. I guess I just need a quick tip!
I want to create a new structure, based on some already existing structures called "Measurement1", "Measurement2" ects… (size : 1×1). But I would like to do it in a smart way by using a loop. It works when I assigned each of them directly, but as soon as it's about a loop, it generates the error "Index exceeds matrix dimensions."
You will find below my code where each value is assigned arbitrary, just in order to give you an idea of what I'm looking for. Instead of having "1","2", I would like to index it.
MeasurementNumber = 'MeasurementData';Pressure = 'Pressure';Frequency = 'Frequency';Absorbance = 'Absorbance';value = {Measurement1; Measurement2;}value2 = {Measurement1.PRESSURE; Measurement2.PRESSURE;}value3 = {Measurement1.FREQ; Measurement2.FREQ;}value4 = {Measurement1.ABSORBANCE; Measurement2.ABSORBANCE;}Structure = struct(MeasurementNumber,value,Pressure,value2,Frequency,value3,Absorbance,value4)
I got the error when I run this one :
for i=1:nFile;value = {Measurement(i)};end
Thank you for your precious help ! (Sorry for potential English mistakes, I'm not a native speaker !)
Best Answer