What's the matter!

4 次查看(过去 30 天)
Francesco
Francesco 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 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by