What's the matter!

조회 수: 3 (최근 30일)
Francesco
Francesco 2014년 2월 14일
답변: Kelly Kearney 2014년 2월 14일
My MATLAB when start my run said this one:
??? Warning: Struct field assignment overwrites a value with class "double".
See MATLAB 7.0.4 Release Notes, Assigning Nonstructure Variables As Structures Displays Warning for details.
Do you Know what's the problem? The version of MATLAB
  댓글 수: 1
Matt J
Matt J 2014년 2월 14일
편집: Matt J 2014년 2월 14일
Use
>>dbstop if warning
and re-run the code to find the command that is causing it.

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

채택된 답변

Kelly Kearney
Kelly Kearney 2014년 2월 14일
My guess is you're reusing a variable name, for example
a = 1;
a.b = 2;
The warning is letting you know that by assigning a field b to the variable a, you are overwriting the double array a with a structure array named a. If you do initialize the structure first, it will avoid the error.
a = 1;
a = struct;
a.b = 2;

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by