array from matrix equations

조회 수: 2 (최근 30일)
harley
harley 2013년 9월 1일
i have a matrix that solves 4 unknowns, instead of writing Va1 = ....(see below) four times is there a more efficient way to do this so i have a Va array.
%example.
Vo = [2 3 4 5]% Vo Vectors
%
Vn = X\Y; % Solves at set of 4 unknowns
%
Va1 = (alpha*Vn(1))+((1-alpha)*Vo(1));
Va2 = (alpha*Vn(2))+((1-alpha)*Vo(2));
Va3 = (alpha*Vn(3))+((1-alpha)*Vo(3));
Va4 = (alpha*Vn(4))+((1-alpha)*Vo(4));

채택된 답변

Chandrasekhar
Chandrasekhar 2013년 9월 1일
Vo = [2 3 4 5];
Vn - X/Y;
for i = 1:4
Va(i) = (alpha * Vn(i)) + ((1-alpha) * Vo(i));
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by