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

조회 수: 1 (최근 30일)
Maheen Fazal
Maheen Fazal 2019년 10월 17일
댓글: Maheen Fazal 2019년 10월 17일
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

채택된 답변

Yuan Li
Yuan Li 2019년 10월 17일
Use matrix operation directly.
F = 0.4*20 + A;
Then, F will be the vector you want.
  댓글 수: 1
Maheen Fazal
Maheen Fazal 2019년 10월 17일
Yes i can but i want separate values added one by one not all of them simultaneously.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by