Error while connecting from workspace to analog output of MyDaq
1 view (last 30 days)
Show older comments
Rachita Sarangi
on 9 Jan 2023
Commented: Joel Van Sickel
on 10 Jan 2023
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
0 Comments
Accepted Answer
Joel Van Sickel
on 10 Jan 2023
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 Comments
Joel Van Sickel
on 10 Jan 2023
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
More Answers (0)
See Also
Categories
Find more on Sources in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!