このコードセクションでエラーが発生しています
X=imread ('Lighthouse.jpg'); %reads picture as int8 matrix
figure, imagesc(X), colormap gray, title('original picture'), % display picture
filter=[-1 0 1; -2 0 2; -1 0 1]; % builds Sobel filter matrix
filter=single(filter); %convert double to single
x=single(X); % convert int8 to single
x=x/max(max(x)); %normalisation to [0,1]
私が得るエラー:
Error using /
Inputs must be 2-D, or at least one input must be scalar.
To compute elementwise RDIVIDE, use RDIVIDE (./) instead.
Error in sobel (line 10)
x=x/max(max(x)); %normalisation to [0,1]
また、./
提案どおりに使用すると、新しいエラーが発生します。
Array dimensions must match for binary array op.
Error in sobel (line 10)
x=x./max(max(x)); %normalisation to [0,1]
正規化のステップで何か間違ったことをしています。
この問題を解決するにはどうすればよいですか?