MATLAB Answers


Convert matrix to constant

Hi everybody, Am having sampled matrix data of size(194*1) in workspace. I have to import to simulink blocks of same samples (194 value). Give me suggestion pls.

           Thank you in advance!!!!


Log in to comment.

1 Answer

Answer by Fangjun Jiang on 10 Oct 2011

Use the "From Workspce" block. Have your time vector and data vector arranged in two column format as below:



If I am using this, am getting an error like this.
Error using ==> horzcat
CAT arguments dimensions are not consistent.

Is there any other way to solve this problem?

Try a simple example first. In MATLAB Command Window, run this first.
Then set the data for the "From Workspace" block as [t,d]. Remember, you need to set the data as two column with the same size. First column is time stamp, second column is your data.

Log in to comment.

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!