the structure has a fieldname and the value is a array. now i want the field 1x1 from this array in matlab

To access the value of field 1x1 from an array in Matlab, you can use indexing. Here is an example of how to do it:

main.m
% Define your structure
myStruct.fieldname = [1 2 3; 4 5 6; 7 8 9];

% Access the value of field 1x1
value = myStruct.fieldname(1, 1);

% Display the value
disp(value);
169 chars
9 lines

In the above example, we define a structure myStruct with a field fieldname which has a 3x3 array as its value. We then use indexing to access the value at position 1x1 (i.e., the first row and first column) of the array using myStruct.fieldname(1, 1). Finally, we display the value using disp.

related categories

gistlibby LogSnag