Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[SIMULINK] reshape a column vector of unknown size to [4, ???] matrix ?

212 views
Skip to first unread message

Thomas Vogel

unread,
Aug 18, 2003, 2:37:00 AM8/18/03
to
Hi all,

i've already asked this question, but unfortunately no applicable answer
was available.

The problem:
I have a frame-based column vector with unknown size and want to reshape
it to a [4, ??] matrix. The available reshape block has no inputports
for its parameters but just a mask. So i have no chance to give him the
size of the vector dynamically.

Does anybody has an idea how to solve this problem?

Thanks for all help
Th. Vogel

Jordan Rosenthal

unread,
Aug 18, 2003, 8:02:48 AM8/18/03
to
Thomas,

I am not a Simulink person, but I imagine you could probably call the Matlab
function RESHAPE with an empty matrix for the unknown size:

y = reshape(x, 4, []);

Jordan

Thomas Vogel wrote:

--
Jordan Rosenthal
MIT Lincoln Labs
j...@ll.mit.edu


Thomas Vogel

unread,
Aug 18, 2003, 9:53:30 AM8/18/03
to
Jordan Rosenthal wrote:

> Thomas,
>
> I am not a Simulink person, but I imagine you could probably call the Matlab
> function RESHAPE with an empty matrix for the unknown size:
>
> y = reshape(x, 4, []);
>
> Jordan
>

Hi Jordan,

thanks for your help.
Unfortunately with this settings i get just a vector with the size of 4.
I also tried to use [4, -1] but the block does not accept it.

Any other hints?
Th. Vogel

Thomas

unread,
Aug 18, 2003, 11:07:14 AM8/18/03
to


I'm not sure about the implications of "framebased but how about a
function call block to either <reshape> itself or to
<set_param> to change the mask parameter?


hth
Thomas

Thomas Vogel

unread,
Aug 18, 2003, 12:10:35 PM8/18/03
to
Thomas wrote:

citation:
A frame of data is a collection of sequential samples from a single
channel. In Simulink, a length-M frame of data is represented by an
M-by-1 matrix (column vector). A multichannel signal with N channels and
M samples per frame is represented as an M-by-N matrix.

The problem is the dynamic structure of the model. The size of the
column vector changes every time, so i can not use any static settings
like set_param. Either the block has an input that gets the size of
frame by another block or the block itself has to support dynamic
parameters.

And so i need just another idea.

Th. Vogel

Steve Conahan

unread,
Aug 18, 2003, 4:45:17 PM8/18/03
to
"Thomas Vogel" <Thomas...@likeabird.de> wrote in message
news:bhqtp8$p6j$03$1...@news.t-online.com...

Hi Thomas,

Perhaps you could use a fixed-length column vector signal of the maximum
size that you would need (combined with a control signal that tells the
downstream block how many of the samples in the vector are "valid" samples).
Just a thought.

hth,
Steve

Thomas Vogel

unread,
Aug 18, 2003, 5:03:18 PM8/18/03
to

> Hi Thomas,
>
> Perhaps you could use a fixed-length column vector signal of the maximum
> size that you would need (combined with a control signal that tells the
> downstream block how many of the samples in the vector are "valid" samples).
> Just a thought.
>

Thanks for your idea, but it is not usable. I want to simulate a
wireless network where the receiver knows nothing (except the basics)
about the transmitter. And while the transmitter transmits the whole
frame it is not able to receive a "acknowledge" frame from the receiver,
which makes the whole network extremly slow.

And so i hope for another idea :-)

Thanks
Th. Vogel

0 new messages