For Loop using in an array to find the value one by one
1 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Yuan Li
2019-10-17
Use matrix operation directly.
F = 0.4*20 + A;
Then, F will be the vector you want.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!