i need your Help, how to do you put your output in a Column array ?
like this
ans = *
*
*

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 5월 25일

0 개 추천

It depends on how the answer is generated. Suppose the following cases.
>> x = {1, 2, 3, 4};
>> x{:}
ans =
1
ans =
2
ans =
3
ans =
4
You can get an answer as a column matrix with the following code
>> x = {1, 2, 3, 4};
>> [x{:}].'
ans =
1
2
3
4
If it is generated using a struct then
>> s(1).a = 1;
s(2).a = 2;
s(3).a = 3;
s(4).a = 4;
>> s.a
ans =
1
ans =
2
ans =
3
ans =
4
Then use this to create column matrix
>> s(1).a = 1;
s(2).a = 2;
s(3).a = 3;
s(4).a = 4;
>> [s.a].'
ans =
1
2
3
4

카테고리

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

태그

질문:

2020년 5월 25일

답변:

2020년 5월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by