필터 지우기
필터 지우기

error in double to struct not possible??

조회 수: 1 (최근 30일)
preeti
preeti 2015년 8월 19일
댓글: Guillaume 2015년 8월 19일
function img=read_query(filename)
I=imread(filename);
[c1,c2,e1,h,v,e2]=glcm_feature_extraction(I)
xlswrite('qfile.xlsx',[c1,c2,e1,h,v,e2]);
c1,c2,...... are floating point numbers.....
error using ==>horzcat
following error has occured converting from double to struct...conversion of double to struct is not possible.
thanks in adv

답변 (1개)

Walter Roberson
Walter Roberson 2015년 8월 19일
Mathworks does not supply any routine named glcm_feature_extraction(), and there is no routine by that name in the File Exchange, so we have no idea what your outputs are.
Your code can only work in the form it is now if all of the outputs c1, c2, e1, h, v, e2 are either strings or numeric arrays that have the same number of rows for every entry. The error message is consistent with at least one of the items instead being a structure of some kind. You need to examine
class(c1), class(c2), class(e1), class(h), class(v), class(e2)
I speculate that either h or v is the structure.
  댓글 수: 1
preeti
preeti 2015년 8월 19일
function [Contrast,cor,ener,homo,V,E]=glcm_feature_extraction(I1)
Contrast1 = graycoprops(graycomatrix(rgb2gray(I1)),'Contrast')
cor1= graycoprops(graycomatrix(rgb2gray(I1)), 'Correlation')
ener1 = graycoprops(graycomatrix(rgb2gray(I1)), 'Energy')
homo1 = graycoprops(graycomatrix(rgb2gray(I1)), 'Homogeneity')
img = double(I1);
V1 = var((img(:)))
E1=entropy(I1)
Contrast = round(Contrast1* 1e1) / 1e1
cor= round(cor1* 1e1) / 1e1
ener=round(ener1* 1e1) / 1e1
homo=round(homo1* 1e1) / 1e1
V=round(V1* 1e1) / 1e1
E=round(E1* 1e1) / 1e1

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by