hi , How do I activate the i (subscript) in Subscript[A, i] in order to display output in mm of array

조회 수: 1 (최근 30일)
for r=1:(n-1)
for i=1:mm
if (out(i,1)<z(r)&z(r)<out(i,2))
for j=1:mm
if (out(j,1)<z(r+1)&z(r+1)<out(j,2))
Subscript[A, i](r)=Mid(j);
end
end
end
end
end
  댓글 수: 3
mohammed elmenshawy
mohammed elmenshawy 2016년 8월 15일
i need the final output as mm of array ,, for exampel if (out(3,1)<z(4)&z(4)<out(3,2)) if (out(6,1)<z(5)&z(5)<out(6,2)) then the output is A3(4)=Mid(6) %such that 3 in last statment a result of loop . then in the code the output is A1,A2,..., Amm
Geoff Hayes
Geoff Hayes 2016년 8월 15일
So...what is Subscript and what is A?
I would advise against using dynamically created variables which is what I think you are suggesting with your A1, A2, etc. This will just lead to errors. Better to use a cell array to collect all of this data.

댓글을 달려면 로그인하십시오.

답변 (1개)

Stephen23
Stephen23 2016년 8월 15일
편집: Stephen23 2019년 6월 19일

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by