### Translated by

이 페이지의 내용은 영어에서 자동 번역되었습니다. 자동 번역 기능을 해제하려면 "<a class="turn_off_mt" href="#" onclick="window._kiq.push(['set', { 'event': 'Turn off MT' }]);">여기</a>"를 클릭하십시오.

## Why do I get the "Subscripted assignment dimension mismatch" error message?

### MathWorks Support Team (view profile)

on 27 Feb 2012
Latest activity Edited by MathWorks Support Team

### MathWorks Support Team (view profile)

on 3 Jan 2019
Accepted Answer by MathWorks Support Team

### MathWorks Support Team (view profile)

Why do I get the following error message sometimes:
??? Subscripted assignment dimension mismatch.
??? In an assignment A(I) = B, the number of elements in B and
I must be the same.

### MathWorks Support Team (view profile)

on 3 Jan 2019
Edited by MathWorks Support Team

### MathWorks Support Team (view profile)

on 3 Jan 2019

This error occurs when you attempt to assign elements to an existing array, but the size of the variable you are trying to assign is not compatible with the existing array. For example, the following code snippet produces this error:
A = [1 2 3; 4 5 6];
B = [7 8 9 10];
A(2,:) = B
In this case, 'A' has size 2x3, that is, 2 rows and 3 columns. The vector 'B' has size 1x4, 1 row and 4 columns. The assignment statement attempts to replace the second row of 'A' with the row vector 'B', but this is not possible because 'B' has 4 columns, and 'A' only has 3 columns. In order to assign to the second row of 'A', you must use a vector with 3 columns. For example,
B = [11 12 13];
A(2,:) = B
For more information on indexing in MATLAB, see the following documentation page:

### durukan dilek (view profile)

on 6 Sep 2018
Edited by durukan dilek

### durukan dilek (view profile)

on 6 Sep 2018

TE=U+T;
SE1=simplify(diff(TE,'UMN'));
SE2=simplify(diff(TE,'VMN'));
SE3=simplify(diff(TE,'WMN'));
SE4=simplify(diff(TE,'RTXMN'));
SE5=simplify(diff(TE,'RTYMN'));
%DYNSTIFF=sym(zeros(5,5));
%FIRST ROW IN DYNAMIC STIFFNESS MATRIX
* _DYNSTIFF(1,1)=subs(subs(subs(subs(subs(SE1,UMN,1),VMN,0),WMN,0),RTXMN,0),RTYMN,0);_*
I got same error "Subscripted assignment dimension mismatch" about row with star