Error while connecting from workspace to analog output of MyDaq

조회 수: 1 (최근 30일)
Error evaluating registered method 'SetInputPortDimensions' of MATLAB S-Function 'saob' in 'untitled/Analog Output'. The following is the MATLAB call stack (file names and line numbers) that produced this error: ['C:\Program Files\MATLAB\R2022a\toolbox\daq\daqblks\daqsfcn\saob.m'] [160] ['C:\Program Files\MATLAB\R2022a\toolbox\simulink\ui\studio\config\m\+SLStudio\StartPauseContinue.p'] [0] ['C:\Program Files\MATLAB\R2022a\toolbox\simulink\ui\studio\config\m\+SLStudio\ToolBars.p'] [0]
Caused by:
  • The input of input port 1 needs to be a 1-D scalar, or a 2-D matrix of size N-by-2.
Component:Simulink | Category:Model error
Error in port widths or dimensions. 'Output Port 1' of 'untitled/From Workspace' is a one dimensional vector with 1000000 elements.
Component:Simulink | Category:Model error

채택된 답변

Joel Van Sickel
Joel Van Sickel 2023년 1월 10일
It looks like your value of x has 1,000,000 dimensions. Is it a vector based on time? THe constant block should have a scalar put in to it to work. If you want the play a vector that changes over time, you'll need to use a different block like the from workspace block.
  댓글 수: 2
Rachita Sarangi
Rachita Sarangi 2023년 1월 10일
Thank you for your reply. However I was trying to load the data in x into the from work space block. Will it work?
Joel Van Sickel
Joel Van Sickel 2023년 1월 10일
sorry, I missed that. The issue is probably that you don't have a time domain vector with x, so x was read in as 1 million element vector with 1 sample per element (instead of a 1 element vector with 1 million samples). If you transpose x into a column vector, and add a time vector, the from workspace should work.
You could also try reading directly from the spreadsheet. You will need to reformat your spreadsheet and again, add a time stamp: https://www.mathworks.com/help/simulink/slref/fromspreadsheet.html

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

추가 답변 (0개)

카테고리

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

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by