急急急!!!!!!!!!!!!matlab求教

X=imread('sjnj.bmp');
[i,j]=find(X>=128);
i和j是X中满足条件的点的坐标,然后我需要一个结构体p[count],把i和j放入p[count]中,让
p[count].x=i,p[count].y=j;
由于i和j的大小没法确定,所以需要使得count能够实现自加
>> count=1:length(m);
>> p=cell2struct(mat2cell([m(:) n(:)],count),[1 1],{'x''y'},2)
提示
Error using mat2cell (line 107)
Input arguments, D1 through D2, must sum to each dimension of the input
matrix size, [4236 2].'

有点乱。

1、你前面读图片用的符号是i、j,后面怎么成了m、n?

2、我上次给你的答案是(i、j、s换成了m、n、p)

p=cell2struct(mat2cell([m(:) n(:)],ones(1,length(n)),[1 1]),{'x' 'y'},2)

你把它全改乱了啊。

温馨提示:答案为网友推荐,仅供参考