format of an output of a function

1 view (last 30 days)
alpedhuez
alpedhuez on 24 Jan 2021
Commented: alpedhuez on 25 Jan 2021
Suppose A is 100*1 categorical and B is 100*1 categorical . As I run ismember(A,B), output is like
ans = 100*1 logical array
1
1
1
1
1
1
1
.
.
.
Thus I cannot see the output unless I auto-scroll that is not convenient. Is there any other way to display the output? For example, is it possible to have an output that does not require auto-scroll in the horizontal format such as
ans = 1 1 1 1 1 1 1 1 1 (100 of 1s)

Accepted Answer

Walter Roberson
Walter Roberson on 24 Jan 2021
ismember(A,B).'
you would have received a row vector if A was a row vector
ismember(A(:).',B)
  3 Comments
alpedhuez
alpedhuez on 25 Jan 2021
Thank you. Let me work on it.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!