Hi,
I am trying to store the output of a calculation
5
6
9
10
which is a vector into an array. Can someone please help? TIA

답변 (1개)

Bryant Lash
Bryant Lash 2019년 4월 16일

0 개 추천

Hi, it's not clear what you're trying to accomplish. Is
Array = [5,6,9,10]
a suitable answer? If not, please be more speicific with your issue.

댓글 수: 6

Kiruthiga Sekar
Kiruthiga Sekar 2019년 4월 16일
Thanks for your reply. But that is not what I am looking for. I've attached the matlab and csv files,I would like to store the value of idx in an array. TIA
Bryant Lash
Bryant Lash 2019년 4월 16일
편집: Bryant Lash 2019년 4월 16일
So in this case, you would like 0.7 and 0.9 stored in an array?
You can accomplish this by adding the following line at the end.
Array = info(idx)
Kiruthiga Sekar
Kiruthiga Sekar 2019년 4월 16일
No. [4 7] (index of non zero values) to be in array
Bryant Lash
Bryant Lash 2019년 4월 16일
편집: Bryant Lash 2019년 4월 16일
Okay. idx is already a vector, which is practically identical to an array ( see https://www.mathworks.com/matlabcentral/answers/342697-what-s-the-difference-between-vectors-and-arrays )
Are you trying to append it to an already existing array?
You can accomplish that by
AlreadyExistingArray(:,end+1) = idx;
Assuming that they are the same size.
Kiruthiga Sekar
Kiruthiga Sekar 2019년 4월 16일
Thanks a lot for the information :)
Bryant Lash
Bryant Lash 2019년 4월 16일
Did that answer your question?

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

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2019년 4월 16일

댓글:

2019년 4월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by