some variable viewer confusion

조회 수: 2 (최근 30일)
Lauren
Lauren 2025년 3월 10일
댓글: Lauren 2025년 3월 11일
When I enter in a code to form a matrix variable (my code is shown below) the first 600 entries are zeros and its affecting the rest of my code. I dont know what to do. The image shows the first few columns but it goes on for a while. Please help me this is for a project!!!
pd=0.1:0.001:25;
  댓글 수: 7
Voss
Voss 2025년 3월 11일
There may be other code later on in your script (or in a script or function called from your script, etc.) overwriting Pd.
Can you upload the complete code (using the paperclip button)?
Lauren
Lauren 2025년 3월 11일
I figured it out there was a problem with another part of my code thank you so much.

댓글을 달려면 로그인하십시오.

답변 (1개)

Image Analyst
Image Analyst 2025년 3월 11일
I believe you're checking it after you've overwritten it with code later on down in your script. Set a breakpoint on line 9 and when it stops there, then look at it in the variable viewer. It should not be zeros. Then set breakpoints periodically down your script (or whenever Pd is mentioned on a line of code, checking Pd at each stop until you find out where it goes to all zeros.
  댓글 수: 1
Walter Roberson
Walter Roberson 2025년 3월 11일
Especially if at some point you round(Pd)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by