i have a structure array. the structure has fieldnames and arrays as values. now i want from structure array 2 the value 1x1 in matlab

To access a specific value in a structure array in MATLAB, you can use indexing. Here is an example of how to access the value of the first element in a structure array:

main.m
% Define the structure array
myStruct(1).fieldname = [1 2 3];
myStruct(2).fieldname = [4 5 6];

% Access the value of the first element in the first array
myValue = myStruct(2).fieldname(1)
190 chars
7 lines

In this example, we define a structure array with two elements, each containing a field named "fieldname" with an array as its value. We then access the value of the first element in the second array by indexing into the structure with (2).fieldname(1), which returns the value 4.

gistlibby LogSnag