please help

how can I extract a sample value from a signal in simulink? for example the last sample of a sine function block. can it be done using selector block?

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 30 de Mzo. de 2012

0 votos

If the signal is a vector, then yes, you can use the Select block to pick any element of that vector.

3 comentarios

saima
saima el 30 de Mzo. de 2012
i tried, but error was thrown saying,"Error in port widths or dimensions. Output port 1 of 'simul/Sine Wave1' is a [1x1] matrix."
can you suggest any elaborate explanation please?
K E
K E el 30 de Mzo. de 2012
Editada: K E el 14 de Ag. de 2012
You might try Guy Rouleau's debugging suggestion in this answer
Kaustubha Govind
Kaustubha Govind el 30 de Mzo. de 2012
saima: Like I said, your signal needs to be a vector to be able to use a Selector block. It's acts as if you are indexing into it. For example:
a = [1 2 3];
b = a(3); %This is the type of operation that Selector does
It looks like what you trying to do is get just the sample at t=FinalSimulationTime. Is that correct? Could you explain what you plan to do with this value - will it be used in MATLAB or somewhere else in the model?

La pregunta está cerrada.

Etiquetas

Preguntada:

el 30 de Mzo. de 2012

Cerrada:

el 20 de Ag. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by