1

I have an array of structures in MATLAB and I want to plot all of the values for one key. I know you can print it by doing array.key but for some reason hist(array.key) doesn't work.

Seems simple enough but I couldn't find how to do this.

1 Answer 1

2
clear all
array(10).key = 1:10;
mat = [array.key]
hist(mat)

Try something like the above.

Sign up to request clarification or add additional context in comments.

2 Comments

Oh my god thank you! Simple as that! Makes my life so much easier!
@akk if the answer helped you, it would be good to accept it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.