필터 지우기
필터 지우기

Solving "Subscripted assignment dimension mismatch" error message.

조회 수: 1 (최근 30일)
mmenvo
mmenvo 2012년 10월 30일
Dear all,
In NN toolbox matlab, I want to use Input data which is a 165238 × 9 matrix, means 9 columns and 165238 rows of data as Input. Matlab shows this error "Subscripted assignment dimension mismatch" when I insert the "imaginary" variable at the 8 th colum.
Here is the code I used:
-----------------------------
EX_355 = xlsread('filename.xlsx','B2:B165238');
EX_532 = xlsread('filename.xlsx','C2:C165238');
BA_355 = xlsread('filename.xlsx','D2:D165238');
BA_532 = xlsread('filename.xlsx','E2:E165238');
BA_1064 = xlsread('filename.xlsx','F2:F165238');
Reff = xlsread('filename.xlsx','G2:G165238');
nm = xlsread('filename.xlsx','H2:H165238');
real = xlsread('filename.xlsx','I2:I165238');
imaginary = xlsread('filename.xlsx','J2:J165238');
mode_width = xlsread('filename.xlsx','K2:K165238');
Input(1,:) = EX_355;
Input(2,:) = EX_532;
Input(3,:) = BA_355;
Input(4,:) = BA_532;
Input(5,:) = BA_1064;
Target(1,:) = Reff;
Input(6,:) = nm;
Input(7,:) = real;
Input(8,:) = imaginary;
Input(9,:) = mode_width;
--------------------------------------------------------------------
after reading Input(8,:) = imaginary; matlab shows the error message.
I have a snapshot of the data, but do not know how to attach it with this Question here.
How to solve this problem? I could not solve it so far by taking matlab error message solutions help. I hope someone will help me in this regard. Thanks
  댓글 수: 4
Jonathan Epperl
Jonathan Epperl 2012년 10월 31일
The data types aren't the issue, the dimensions of your variables are. So why don't you just do a clear all, run the lines of code up to and including mode_width = xlsread('filename.xlsx','K2:K165238');, then run
whos
and post the output here?
Jan
Jan 2012년 10월 31일
@Jonathan: I do not see any reason to remove all loaded function files from the memory and delete all persistent data as well as globals. The re-initialization an the new parsing of all used functions waste a lot of time. Therefore I strongly recommend not not use clear all but clear the concerned variables explicitly, or at least only variables: clear variables.

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

답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by