I'm using R2022a, in Simulink I can not find the Display tab to access Signals & Ports>Signal Dimensions. Could someone point me in the right direction please?. Also, in the figure below the dimensions are 5x1. The signals are 𝑥(𝑡) = 5 sin(2𝜋10𝑡), how was the 5x1 dimension determined by the program? What are the parameters that affect the signal dimension? Thanks in advance.
1 Answer
The signals are 𝑥(𝑡) = 5 sin(2𝜋10𝑡), how was the 5x1 dimension determined by the program?
In MATLAB everything is a vector. If you try to write the following code
x = cos(2*pi*t);
MATLAB will complain, because it doesn't know what t
is. You need to first define t
as a vector (or a number) if you want to use it.
fs = 20; %Define sampling frequency
t = 0:1/fs:2-1/fs; %Create time vector with 1/fs increment
x = cos(2*pi*t); %Create function vector from t
plot(t,x)
x
and t
have the same dimensions. You can find the dimensions of a vector using the size
command. In my case, I get
>> size(t)
ans =
1 40
because my t
vector has 1 row and 40 columns. This is what a signal dimension in MATLAB is.
I can not find the Display tab to access Signals & Ports>Signal Dimensions. Could someone point me in the right direction please?