Confusion about Selector and difference between 'Dimension' & 'Column'

2 vues (au cours des 30 derniers jours)
Lofi
Lofi le 12 Avr 2011
Hi guys, I am new to Matlab and not a native English speaker, so I met some problem with Selector block and the definition of Dimension. Could someone help me?
1. Definition I think the definition of 'Dimension' in matrix is the same with Column, am I right?
2.I am now studying the demo "Chroma based road tracking", and the Selector in Lane tracking is confused me.
The parameters is:
RowNo / Index option / Index / Outputsize
1 / Select all
2/ Starting index / 0 / 1
The input data is :
simout =
144.0000 21.7691
0.8727 2.0595
Based on my understanding of Selector, each row in parameter list is focus on the corresponding dimension of input data.
So for the first dimension, the result should be: [144;0.8727].
and the second dimension is : [21.7691]
The authentic result is : [144;0.8727], obviously there are some misunderstandings occurs. I hope someone could help me with this, thank you very much~

Réponse acceptée

Kaustubha Govind
Kaustubha Govind le 12 Avr 2011
In Simulink, a signal can have any number of dimensions: a 1-D signal is a vector, a 2-D signal is a matrix (eg. dimensions 3x4), you can also have 3-D (eg. dimensions 3x4x5) and 4-D (eg. dimensions 3x4x5x6) signals (and so on). So I guess you can think of the word "dimensions" as the number of co-ordinates needed to represent a sample point.
According to the block parameters, you select all numbers along the first dimension (which is rows) - this means you want to select all rows. We want to select only the 0 index from the second dimension (which means only the first column). So we want to select all rows from the first column.
If you are a MATLAB programmer, you can translate this to:
output = input(:,1)
(Note that since the block is in zero-indexing mode, the '0' index really corresponds to the index=1 in MATLAB).
  2 commentaires
Lofi
Lofi le 24 Avr 2011
THX for your answer, I think this is the same way as SQL query, right?
Kaustubha Govind
Kaustubha Govind le 24 Avr 2011
Sorry, I'm not familiar with SQL Queries.

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by