Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 204531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:28:33+00:00 2026-05-11T17:28:33+00:00

In MATLAB, how do you tell where in the code a variable is getting

  • 0

In MATLAB, how do you tell where in the code a variable is getting output?

I have about 10K lines of MATLAB code with about 4 people working on it. Somewhere, someone has dumped a variable in a MATLAB script in the typical way:

foo

Unfortunately, I do not know what variable is getting output. And the output is cluttering out other more important outputs.

Any ideas?

p.s. Anyone ever try overwriting Standard.out? Since MATLAB and Java integration is so tight, would that work? A trick I’ve used in Java when faced with this problem is to replace Standard.out with my own version.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:28:34+00:00Added an answer on May 11, 2026 at 5:28 pm

    Ooh, I hate this too. I wish Matlab had a “dbstop if display” to stop on exactly this.

    The mlint traversal from weiyin is a good idea. Mlint can’t see dynamic code, though, such as arguments to eval() or string-valued figure handle callbacks. I’ve run in to output like this in callbacks like this, where update_table() returns something in some conditions.

    uicontrol('Style','pushbutton', 'Callback','update_table')
    

    You can “duck-punch” a method in to built-in types to give you a hook for dbstop. In a directory on your Matlab path, create a new directory named “@double”, and make a @double/display.m file like this.

    function display(varargin)
    builtin('display', varargin{:});
    

    Then you can do

    dbstop in double/display at 2
    

    and run your code. Now you’ll be dropped in to the debugger whenever display is implicitly called by the omitted semicolon, including from dynamic code. Doing it for @double seems to cover char and cells as well. If it’s a different type being displayed, you may have to experiment.

    You could probably override the built-in disp() the same way. I think this would be analagous to a custom replacement for Java’s System.out stream.

    Needless to say, adding methods to built-in types is nonstandard, unsupported, very error-prone, and something to be very wary of outside a debugging session.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 105k
  • Answers 105k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I guess GetVersionEx(), which returns OSVERSIONINFOEX will do:' VER_SUITE_SMALLBUSINESS :… May 11, 2026 at 8:40 pm
  • Editorial Team
    Editorial Team added an answer I came across this on CodeProject. It'll capture keystrokes while… May 11, 2026 at 8:40 pm
  • Editorial Team
    Editorial Team added an answer Use "git checkout 2.8". If you want to move "stable",… May 11, 2026 at 8:40 pm

Related Questions

I have an RGB image in MATLAB, and I want to loop through each
I have large data sets (10 Hz data, so 864k points per 24 Hours)
From discussions I've had about language design, it seems like a lot of people
I want to apply a function to all columns in a matrix with MATLAB.
Usually when I plot in MATLAB , it always draws on the same figure.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.