Dimensions of arrays being concatenated are not consistent.

조회 수: 1 (최근 30일)
Ramesh Bala
Ramesh Bala 2019년 9월 19일
답변: Adam 2019년 9월 19일
Here all the variable are of 1X3 except velocity which is 1X2
So,how shall I add even that value in the sheet ? as I get Dimensions of arrays being concatenated are not consistent error
%save as excel
filename = 'Nomexhole2.xls';
Results_Names={'Amp','N','T','velocity'};
Results_Values=[Amp',N',T',velocity.'];
sheet=1;
xlRange='A1';
xlswrite(filename,Results_Names,sheet,xlRange);
sheet=1;
xlRange='A2';
xlswrite(filename,Results_Values,sheet,xlRange);
winopen('Nomexhole2.xls');
  댓글 수: 6
Adam
Adam 2019년 9월 19일
Results_Values=[Amp',N',T',[velocity NaN].'];
should also work.
Ramesh Bala
Ramesh Bala 2019년 9월 19일
편집: Ramesh Bala 2019년 9월 19일
Thank you Bob and Adam
When I used Preallocation it showed Unable to perform assignment because the size of the left side is 3-by-4 and the size of the right side
is 5-by-3
But [velocity NaN] worked well ,also I've used this command also worked
velocity(end+1:numel(T))=0;
Thank you again !
Kindly put this agian in the answer this question section ,so that I can mark it as complete with a vote.

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

채택된 답변

Adam
Adam 2019년 9월 19일
Results_Values=[Amp',N',T',[velocity NaN].'];

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by