Is FORMAT DEBUG still any useful?

조회 수: 10 (최근 30일)
Bruno Luong
Bruno Luong 2021년 1월 13일
댓글: cr 2023년 8월 2일
Can someone has an explanation for this (R2020B)
clear
clc
x=1;
y=x;
x=x+1;
format debug
y
x
that produces
y =
Structure address = 23ebc936f80
m = 1
n = 1
pr = 23edbdd6660
1
x =
Structure address = 23ebc936f80
m = 1
n = 1
pr = 23edbdd6660
2
So x and y have the same structure address and data address, yet data are different (1 for y and 2 for x).
Finish the time where FORMAT DEBUG returns useful information for us.
  댓글 수: 2
James Quinlan
James Quinlan 2021년 6월 30일
Hi Bruno, were you able to submit a bug report? I am running into similar issues. I am performing memory tests and tests are unreliable in light of your comment. I reproduce results from both you and James Tursa below giving same addresses for x and y even after x has been modified. I am running Version: 9.10.0.1602886 (R2021a).
My test is slightly different in the sense, I assign x a value, then pass it to a function and make assignment, y = x. From my understanding, if you pass x to a function and don't update it while there, it effectively is pass by reference.
Bruno Luong
Bruno Luong 2021년 7월 1일
편집: Bruno Luong 2021년 7월 1일
Hi James,
I did not submitted a BUG report. IMO TMW has changed complemetly the shared memory paradism and they just are not willing to share the new mechanism.

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

채택된 답변

James Tursa
James Tursa 2021년 1월 13일
Strange behavior and probably deserves a bug report. E.g.,
R2019a:
>> x = 1;
>> y = x;
>> x = x + 1;
>> format debug
>> y
y =
Structure address = fa4a7890
m = 1
n = 1
pr = 119f97b20
1
>> x
x =
Structure address = fa4a76d0
m = 1
n = 1
pr = 17c869780
2
R2019b:
>> x = 1;
>> y = x;
>> x = x + 1;
>> format debug
>> y
y =
Structure address = f7ef7ac0
m = 1
n = 1
pr = 145dbaec0
1
>> x
x =
Structure address = f7ef7ac0
m = 1
n = 1
pr = 145dbaec0
2
R2020a:
>> x = 1;
>> y = x;
>> x = x + 1;
>> format debug
>> y
y =
Structure address = 192d47e2d40
m = 1
n = 1
pr = 192d3b7a5c0
1
>> x
x =
Structure address = 192d47e2d40
m = 1
n = 1
pr = 192d3b7a5c0
2
So the problem goes back as far as R2019b.
  댓글 수: 1
cr
cr 2023년 8월 2일
Is there a closure to this? I still see the same behaviour in 2023a.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by