MATLAB Answers

Show Only certain variables in the workspace

36 views (last 30 days)
Alex on 30 Aug 2016
Edited: Stephen Cobeldick on 30 Aug 2016
Hi everybody,
in my scripts I have defined a lot of variables, matrices, vectors and structs. These appear all in the workspace. Now I want to display only specific variables,to have a better overview.
I know, i should work from the beginning with functions instead of Script but i didn´t know it. I tried to rewrite scripts in functions, but it so complicated and im afraid that my Code wil not work after i edit it.
i will appreciate any Help

  1 Comment

Stephen Cobeldick
Stephen Cobeldick on 30 Aug 2016
That is part of the learning process: you learn a better way of doing something, and then you have a choice: to keep doing things the old (slow, inefficient, buggy) way, or rewrite everything and do it a better way.
Functions are much better than scripts for real code, they make managing data much easier, as well as being easier to write, to test, to fix, to understand... why would you even want to keep using scripts?
Rewrite your code to use functions properly and you will not regret it.

Sign in to comment.

Answers (0)


Community Treasure Hunt

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

Start Hunting!