How to convert 'Structure' ?!
Show older comments
Hi everybody;
I am trying to get feature value out of structure array..
for example:
glcms = graycomatrix(CG,'Offset',[0 1]);
Cont_RGB = graycoprops(glcms,'Contrast');
F=Cont_RGB;
F= Contrast: 0.2546 % i wana to remove word contrast and get the number only!
How can i get the number?
Thank you
Accepted Answer
More Answers (2)
Matthew Eicholtz
on 29 Jun 2013
Try
F.Contrast
2 Comments
Mariam Sheha
on 29 Jun 2013
Walter Roberson
on 30 Jun 2013
Cont_RGB = graycoprops(glcms,'Contrast');
Cont_RGB.Contrast
The "." between the variable name and "Contrast" is literal, part of the syntax.
Image Analyst
on 29 Jun 2013
theNumber = F.Contrast;
3 Comments
Mariam Sheha
on 29 Jun 2013
Image Analyst
on 30 Jun 2013
All 3 people answered with the same thing, and you accepted the third response, so I think we all knew what you meant. Hopefully you're now using Walter's answer, and are not doing unnecessary operations like converting to a cell array and then converting the cell array to a matrix. You may find it helpful to read the FAQ: http://matlab.wikia.com/wiki/FAQ#What_is_a_cell_array.3F
Mariam Sheha
on 30 Jun 2013
Categories
Find more on Cell Arrays in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!