Error using horzcat. Dimensions of matrices being concatenated are not consistent.

조회 수: 2 (최근 30일)
I want to call the variable "sigdata" in simulink using from workspace but I am receiving the following error message.
Error using horzcat
Dimensions of matrices being concatenated are not consistent.
time=[0:0.1:1001]';
y1 = wgn(1000,1,0);
time=[0:0.1:101]';
y1 = wgn(1011,1,0);
y2=y1';
sigdata=[time y2];

채택된 답변

Rik
Rik 2017년 11월 27일
time=[0:0.1:101]';
y1=wgn(size(time,2),size(time,1),0);
y2=y1';
sigdata=[time y2];
  댓글 수: 1
Rik
Rik 2017년 11월 27일
This will work just as well btw:
time=[0:0.1:101]';
y2=wgn(size(time,1),size(time,2),0);
sigdata=[time y2];

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by