MATLAB: Assigning values from one matrix in a struct to matrix in another struct

indexingMATLABmatrixmatrix manipulationstruct

This is a struct (let's say A_struct) containing results from some calculations in column 1, and in column 2 and 3 are elements that are causing those results, and they are in the same row (results from calculations that use elements in row 1, columns 2 and 3, are situated in row 1 column 1, etc)
So my question is the following: i have to find a minimum value from column 1, and then asign that whole row to another struct (B_struct). Is there a way to do that?
I tried something like this:
B_struct (1,1) = (min(A_struct(:,1)),1);
B_struct (1,2) = (min(A_struct(:,1)),2);
B_struct (1,3) = (min(A_struct(:,1)),3);
this part min(A_struct(:,1)) should specify row from which i want to copy elements. And it doesn't work.

Best Answer

[~,minIdx] = min(A_struct(:,1));
B_struct = A_struct(minIdx,:);