Constants Improperly Initialized as Arrays

Started working in a new lab and am using computers from previous employees. The problem I have found is that Matlab is currently set to initialize any constants (ex, b= 5;) as double 1x1 arrays. It's been a while since I have worked with Matlab but I can't find what setting was set 'on' or how to change it.

댓글 수: 2

Is there a startup.m file on their path? Try this:
edit startup.m
Are the constants there?
Justin
Justin 2013년 5월 17일
No, there is not. It's initializing all constants as double arrays.

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

 채택된 답변

James Tursa
James Tursa 2013년 5월 17일

0 개 추천

Not sure what your real problem is here. ALL numeric constants in MATLAB (e.g., 5, 1.3, 1.4e8, etc) are double 1x1 arrays (or more specifically matrices) by default in all versions of MATLAB. This cannot be changed. To get a different type you need to explicitly cast (e.g., int32(5)). Are you saying this bothers you? Or are you saying that you are getting a bunch of 1x1 double variables at startup and you don't know where they came from?

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

질문:

2013년 5월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by