필터 지우기
필터 지우기

How to make a loop that would help me with my code?

조회 수: 2 (최근 30일)
daniel choudhry
daniel choudhry 2020년 9월 25일
댓글: daniel choudhry 2020년 9월 25일
I am trying to make c(1),...c(4) is one single process in order to have a c vector. b=[4 1 -3 4] and p=[3 4 2 1]
function c=perm_b(b,p)
n= length(b);
c = zeros(n,1);
for i=1:n
c(1)=b(p(1));
c(2)=b(p(2));
c(3)=b(p(3));
c(4)=b(p(4));
end
end

채택된 답변

David Hill
David Hill 2020년 9월 25일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Partial Differential Equation Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by