MATLAB Answers

.mat block in Simulink

2 views (last 30 days)
pavan kurdekar
pavan kurdekar on 19 Mar 2020
Commented: pavan kurdekar on 20 Mar 2020
Hello,
I want to input matrix of 50501*17 in to matlab function block in Simulink.
I saved the data in workspace as .mat file.
I am using From File block to input it , but when i run the model the matrix size is 50500*1. Why is it ? Can any one help me to get the exact size of the matrix?

Answers (1)

Ameer Hamza
Ameer Hamza on 19 Mar 2020
From the file block, expect the first row of the matrix to be time values, and it loads each column from that matrix at a time according to the current time of the simulation. It is used to load signals which change with time. If you want to read the whole matrix as once, then you should use a constant block and give it same value as the name of the variable in base workspace.
  1 Comment
pavan kurdekar
pavan kurdekar on 20 Mar 2020
Thank you for the reply.

Sign in to comment.

Products

Community Treasure Hunt

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

Start Hunting!