why do i receive error while evaluating UIcontrol Callback?

6 Ansichten (letzte 30 Tage)
NUR AINA BATRISYIA
NUR AINA BATRISYIA am 21 Jan. 2023
Kommentiert: Jan am 22 Jan. 2023
load ('db');
Ftrain=db(:,1:2);
Ctrain=db(:,3);
for(i=1:size(Ftrain,1))
dist(i,:)=sum(abs(Ftrain(i,:)-Ftest)):
end
try to retrieve results from db but it shows "Error while evaluating UIcontrol Callback"
  8 Kommentare
Voss
Voss am 21 Jan. 2023
If "im" is defined in another function, you have to do something to make it accessible in this function, e.g., put it in the handles structure.
Jan
Jan am 22 Jan. 2023
This looks strange:
db=db.mat;
load db;
In the first line, db.mat extracts the field 'mat' of the struct called 'db'. The line
load db
is equivalent to the functional form:
load('db')
which adds '.mat' automatically. This might work by accident in your case. Most likely you mean:
db = 'db.mat';
load(db);
This looks similar, but has important differences.
After
Ftest=FeatureStatistical(im);
failed, because im is not a defined variable inside the current function, the line
db=db.mat;
will fail, because db is not a known variable also.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Produkte


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by