필터 지우기
필터 지우기

Subscripted assignment dimension mismatch error

조회 수: 1 (최근 30일)
marvin
marvin 2014년 2월 15일
댓글: marvin 2014년 2월 16일
%_____________________________________________________________________
clear;clc
% 1. Simulation sample set up
numSample =8; %No of sample batch
sizeSample = 10000; % Sample size set up
warmup = 20000; %warmup size set up
collectSample = zeros(numSample+1,1); %Size of results matrix
%4 Start the simulation and collecting data
se_randomizeseeds('lukumar3autodata'); % Change random number sequence.
sim('lukumar3autodata')
collectSample(:,1) = avg;
%5 Saving the results into excel file
% csvwrite([datestr(now, 30) '(Gamma_Gamma_)' num2str(Ca) num2str(Cs) num2str(uti) '.csv'], collectSample,0,0);
csvwrite([datestr(now, 30) 'Lukumar_T1' '.csv'], collectSample,0,0);
pause(5)
% For neatness, clear some nonimportant variables clear avg tout
I get the error in this line{ collectSample(:,1) = avg; }
Any help would be appreciated. Thank you!

답변 (1개)

Nitin
Nitin 2014년 2월 16일
Not sure if this help but I cannot see the avg in your code.
Have you initialized it?
If you have, does its dimensions match 'collectSample'?
  댓글 수: 1
marvin
marvin 2014년 2월 16일
Thanks, I've solved the issue, I'm not sure why after I repeated it for a few times, it became fine.
What do you mean by initializing avg? I'm running Simulink-Simevents, the 'avg' is saved as an array part of a block.

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by