how should I do when I want to input matrix of logical type into from workspace block in simulink.
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Dear Sir or Madam,
I would like to input matrix of logical type into from workspace block or other block that have similar function in simulink.
But, the from workspace block can't be received logical type.
I'm glad if you tell me the way.
Sincerely,
0 comentarios
Respuestas (1)
Prashant Arora
el 20 de Oct. de 2017
Hi Shunsuke,
To Workspace block does allow you to have logical data into Simulink. That data however, should represent a signal, for example has a relation with simulation time. To do this (using Matrix format), you need to define the MATLAB workspace variable as [t data], where t is the first column and represents time. Consider the following code:
t = 0.2*[0:50]'; %Time Step of 0.2 seconds and Simulation time 10 seconds
% Data represents rows = number of time samples,
% and each column represent data corresponding to that time
data = logical(randi([0 1],numel(t),100));
simin = [t data];
Using this simin variable in the From Workspace variable, you can get a multi dimensional signal(100 dimensions).
0 comentarios
Ver también
Categorías
Más información sobre 信号 en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!