Problem of inserting values into array within a for loop
Mostra commenti meno recenti
Has anyone else met with the problem of MATLAB not liking to assign values to matrix in a for loop? E.g.
for i = 1:14
targetLabel = BLOB_STATS(i,1);
blob = (bm == targetLabel);
perimeterLength = regionprops(blob, 'Perimeter');
BLOB_STATS(i,3) = perimeterLength;
end
But if I use fixed coordinates, e.g. BLOB_STATS(1,3) = perimeterLength; it works fine.
The error I get says: "The following error occurred converting from struct to double: Error using double Conversion to double from struct is not possible."
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!