Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Values in the loop are overwritten

1 visualizzazione (ultimi 30 giorni)
swati mane
swati mane il 2 Ago 2019
Chiuso: MATLAB Answer Bot il 20 Ago 2021
Hello sir ..my code is:
for i=1:1:4; S=M(1:1,i)./20; valueOfB(j)=S; end
I should get 4 different values of S. But same value i am getting four times. Where M is taken for frames 1 to 25...26 to 50 ...51 to 75 and so on.and for M i am getting correct values. And j = 1:25:100.
Thanks in advance.
  4 Commenti
KALYAN ACHARJYA
KALYAN ACHARJYA il 3 Ago 2019
Modificato: KALYAN ACHARJYA il 3 Ago 2019
It's OK, minor modification
valueOfB=zeros(1,4);
for i=1:1:4
valueOfB(i)=M(1,i)/20;
end
Or
valueOfB=M(1,1:4)./20; % Without loop
swati mane
swati mane il 5 Ago 2019
Yes its working.thanks a lot @ kalyan acharjya

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by