hello matlab community, is something wrong with my coding below?
feat=zeros(982,40);
for i=1:982
im1=FYPdatabase{i,1};
featim=gmlog(im1);
FYPdatabase{1,5}=featim;
end
i want to insert future extraction in the database but only number 1 got the result, the rest just shown [] as in figure below. can see attach file. Thnkyou for your help, i really appreciate it!

3 Kommentare

Rik
Rik am 9 Jun. 2023
Please explain how this is different from your previous question. If it is not, please continue your question in the other thread until you can accept an answer there. You can re-open this question if you need to.
RACHEL LYN JAHIRIN
RACHEL LYN JAHIRIN am 9 Jun. 2023
done reopen
Rik
Rik am 9 Jun. 2023
Instead of posting a new question, consider commenting on your previous questions next time. Either explain to the person helping you why their solution didn't work, or accept the answer.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Rik
Rik am 9 Jun. 2023

0 Stimmen

The i strikes again. Never use it as a variable, it is just too similar visually to a 1.
That is what went wrong in your code:
feat=zeros(982,40);
for i=1:982
im1=FYPdatabase{i,1};
featim=gmlog(im1);
%FYPdatabase{1,5}=featim;
FYPdatabase{i,5}=featim;
end
See the difference between the two lines?
Consider using n, m, or k as looping variables. And to use the size of the array to determine the loop count:
feat=zeros(982,40);
for n=1:size(feat,1)

2 Kommentare

RACHEL LYN JAHIRIN
RACHEL LYN JAHIRIN am 10 Jun. 2023
i already changed it but still cannot get.
Rik
Rik am 10 Jun. 2023
I'm a bit confused. Did my solution work for you or not?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2023a

Gefragt:

am 9 Jun. 2023

Kommentiert:

Rik
am 10 Jun. 2023

Community Treasure Hunt

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

Start Hunting!

Translated by