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

  • Home
  • SEARCH
  • 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 582243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:39:58+00:00 2026-05-13T14:39:58+00:00

I like to debug in matlab using commands. some questions: If choose a stack,

  • 0

I like to debug in matlab using commands. some questions:

  1. If choose a stack, is it possible to jump to a specific stack directly instead of moving one stack after another using dbup and dbdown?
  2. After jumping to a middle stack, if I execute some commands, why it auto returns to the inner most stack? Can I stay at the middle stack until I issue a command to leave for another stack?
  • 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-13T14:39:58+00:00Added an answer on May 13, 2026 at 2:39 pm

    1) Not from the keyboard. If you’re using the editor and have the Editor Toolbar displayed, there’s a “Stack” dropdown that shows you the entire call stack, and you can jump to an arbitrary level. You might be able to hack an n-level dbup/dbdown together by looking at what’s in that dropdown, but debugger control is very hard to script from Matlab due to the interaction of the debugger and the M-code you’re using for scripting.

    2) If you issue a command from the “K>>” debugger prompt, when it finishes it ought to return you the the stack level you issued it from, like you expect. Do you still have the breakpoint set at the bottom level of the code? Maybe you’re actually seeing a secondary debugger “K>>” prompt from a breakpoint in the nested call stack. You can essentially have multiple nested debugger contexts.

    For example:

    function f1
    f2();
    function f2()
    f3();
    function f3()
    f4();
    function f4()
    disp('Hello world');
    

    If you throw it in the debugger like this, you’ll hit the breakpoint at the bottom of a call stack which itself was launched from the original debugger session.

    >> dbstop in f1 at 8
    >> f1()
    8   disp('Hello world');
    K>> dbup
    In workspace belonging to f1>f3 at 6
    K>> dbup
    In workspace belonging to f1>f2 at 4
    K>> f1()
    8   disp('Hello world');
    K>> dbstack
    > In f1>f4 at 8
      In f1>f3 at 6
      In f1>f2 at 4
      In f1 at 2
      In f1>f4 at 8
      In f1>f3 at 6
      In f1>f2 at 4
      In f1 at 2
    K>> 
    

    Doing a dbquit (getting out of the nested debugger session) gets you back to the middle of the original call stack where you left off.

    K>> dbquit
    K>> dbstack
      In f1>f4 at 8
      In f1>f3 at 6
    > In f1>f2 at 4
      In f1 at 2
    K>> 
    

    If you dbcont out of your “K>>”, then control flow will resume from the bottom of the call stack, where the breakpoint was originally raised, regardless of what stack frame the K>> is looking at. You can’t use the debugger to change the control flow of the mainline code being executed.

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

Sidebar

Ask A Question

Stats

  • Questions 357k
  • Answers 357k
  • 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 The other answers are correct. Here is some code you… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer you ruin the noConflict concept by reassigning the jquery to… May 14, 2026 at 9:40 am
  • Editorial Team
    Editorial Team added an answer If you get that particular error, you don't actually have… May 14, 2026 at 9:40 am

Related Questions

No related questions found

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.