For Loop using in an array to find the value one by one

1 Ansicht (letzte 30 Tage)
Maheen Fazal
Maheen Fazal am 17 Okt. 2019
Kommentiert: Maheen Fazal am 17 Okt. 2019
Hi Sir, I have an array e.g. A=[19 12 87 34 54] and i have to use the array value one by one to find the F value e.g.F=0.4*20+A so i could i do this??
use for loop? like
n=5;
for N=1:n
A=[19 12 87 34 54]
FF=[];
for i=1
F=0.4*20+A
end
FF=[FF F]
end
kindly help me to find the answer if possile,
Thank you in advance

Akzeptierte Antwort

Yuan Li
Yuan Li am 17 Okt. 2019
Use matrix operation directly.
F = 0.4*20 + A;
Then, F will be the vector you want.
  1 Kommentar
Maheen Fazal
Maheen Fazal am 17 Okt. 2019
Yes i can but i want separate values added one by one not all of them simultaneously.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

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

Community Treasure Hunt

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

Start Hunting!

Translated by