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

Antworten (1)

Ameer Hamza
Ameer Hamza am 25 Mai 2020

0 Stimmen

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

Gefragt:

am 25 Mai 2020

Beantwortet:

am 25 Mai 2020

Community Treasure Hunt

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

Start Hunting!

Translated by