i want to know whether this command is correct or not?

g=regwht(f,125); i am getting error in this . can anybody find out error and rectify it? thanks

2 Comments

As posted, the answer is a definite "NO". Please edit your question and attach the m-file with the paper clip icon, and paste the complete error message here - ALL the text in red color.
Please post a copy of the error message and the relevant part of the code. It is impossible to guess the reasons of the problems without knowing any details.

Sign in to comment.

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 28 Sep 2013
Edited: Azzi Abdelmalek on 28 Sep 2013
your variable f is not defined. What is regwht?

9 Comments

its defined before this line like this f=getdata(vid,1);
i am new to matlab i dont no much . in the programme regwht is used for assigning f,125 to the grayscale image.
ok but what is regwht? type
which regwht
if u want to see the code i will send
vid=videoinput('winvideo',1);
triggerconfig(vid,'manual');
set(vid,'FramesPerTrigger',1);
set(vid,'TriggerRepeat', Inf);
set(vid,'ReturnedColorSpace','rgb');
start(vid);
i=0;
num=zeros(1,2);
while(1)
trigger(vid);
f=getdata(vid,1);
g=reg(f,125);
g=imadjust(g,[0 1],[1 0]);
g=imfill(g,'holes');
w=strel('disk',15);
g=imerode(g,w);
g=imopen(g,w);
%imshow(g);
%disp('frame number:');
%disp(i);
[l num(1,mod(i,2)+1)]=bwlabel(g);
if (num(1,1)~=num(1,2))
disp('number of coins=');
disp(num(1,mod(i,2)+1));
end
i=i+1;
end
this is the code in this i am getting error in g=reg(f,125)
I'am not following you, you said the problem is regwht(f,125) and now it's reg(f,125). I do not know if this code is yours, even it's not, you have to know what this code is doing. reg is a function from control toolbox which gives the gains K and L for regulator and estimator.
I have the same error whether reg(f,125) or regwht(f,125)

Sign in to comment.

Categories

Asked:

on 28 Sep 2013

Commented:

on 8 Dec 2017

Community Treasure Hunt

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

Start Hunting!