Vectorization problem with assignments
조회 수: 2(최근 30일)
표시 이전 댓글
Marcos 2021년 11월 16일
답변: Salman Ahmed 2021년 11월 19일
Good afternoon. I was trying to vectorize the following code in order to make it faster, however I was unable to do so. I can't also imagine about how to do it looking into the MATLAB examples of vectorization MATLAB. I would be very grateful if somebody could give me help about how to do it.
cols = zeros(length(vector1),dims);
cols(i,:) = Vector2(vector1(i),1:dims);
Thank you very much.
댓글 수: 1
Salman Ahmed 2021년 11월 19일
You can use the following to vectorize your loop.
cols = Vector2(vector1,1:dims);
댓글 수: 0
Find more on Scope Variables and Generate Names in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!