how to sum two dimensional variables? and store in a single dimensional variable?

조회 수: 5 (최근 30일)
R=3;
M=[2,4,8];
beta=8;
pa=9;
pb=7.2;
po=0:0.5:12;
for kk=1:length(M)
for ii=1:length(po)
ko(ii)=floor(po(ii)*M(kk)/pa);
psearch=union([0,pb],(M(kk)*po(ii)/(ko(ii)+1)));
for i=1:1:length(psearch)
pp=(M(kk)*po(ii)-psearch(i))/ko(ii);
f(i)=(1-exp(-((2^R-1)/psearch(i))^(beta/2)))+ko(ii)*(1-exp(-((2^R-1)/pp)^(beta/2)));
end
po_cap=min(f);
if po(ii)>=pa
for i=1:M(kk)
p1i(ii,i)=po(ii);
end
end
if po(ii)< pa
for i=1:M(kk)-ko(ii)-1
p2i(ii,i)=0;
end
for i=M(kk)-ko(ii)
p3i(ii,i)=po_cap;
end
for i=M(kk)-ko(ii)+1:M(kk)
p4i(ii,i)=(M(kk)*po(ii)-po_cap)/ko(ii);
end
end
end
end
I need to sum p1i,p2i,p3i,p4i and store in a variable s1power..how can be done?..can someone
suggest a solution?

답변 (1개)

Walter Roberson
Walter Roberson 2014년 4월 2일

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by