I run a test program shown below:
clear all;clc;image_a = imread('doll_full_color','png');histo = histogram(image_a);
error comes:
??? Error: File: histogram.m Line: 12 Column: 30The expression to the left of the equals sign is not a valid target for an assignment.Error in ==> test_his at 5histo = histogram(image_a);
For your information, histogram is a function I defined to calcuate the histogram of an image,shown below:
function [ histo ] = histogram( image )%UNTITLED3 Summary of this function goes here
% Detailed explanation goes here
clc;[row, column] = size(image,3);histo = zeros(256,3);histo_sum = zeros(256,3);for m=1:1:3for i=0:1:255 for j=1:1:row for k=1:1:column if( image(j,k,m) = i) histo_sum(i,m) = histo_sum(i,m) +1; end end endendendhisto = histo_sum/(row*column);end
Anyone can help solve the problem? Thank you!
Best Answer