Call a element of Varying Column vector
9 次查看(过去 30 天)
显示 更早的评论
Kt=rand(6,6);
u=rand(6,6);
for i=1:1:6
for n=1:1:5
fr(:, i)=Kt*u(:,i) % i am try to call earch column of u here for multiplying with Kt, if i am wrong please correct me.
eval(['fr',num2str(n),'=Kt*u(:,i)'])
end
end
%%% Now i want to call each element of fr one by one how can i call it.
0 个评论
采纳的回答
David Hill
2022-4-28
Hard to understand what you are trying to do. Eval statement makes no sense as well as the douple for-loop. Eval would be overriding each i-loop to the same values. Why not just:
Kt=rand(6,6);
u=rand(6,6);
fr=Kt*u;
Then index into fr. To call each element in fr,
for k=1:numel(fr)
fr(k)
end
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!