MATLAB: Obtain simulink signal width simulink I want to access the width(dimension) of a vector in Simulink. I want to use this value in other block. Is it possible? How can I achieve this? Thanking you in advance. Best Answer Simulink > Signal Attributes > Widthhttp://www.mathworks.com/help/simulink/slref/width.html Related SolutionsMATLAB: Obtaining fundamental frequency wave from a PWM signal it seems you want to do a Fourier transform of your signal. See http://www.mathworks.fr/fr/help/matlab/ref/fft.htmlonce you get the Fourier transform results, you can delete all frequencies except for the fundamental one, do a reverse Fourier transform and plot the result. MATLAB: Pwm signal generation f=1e3;a0=0;AmpSin=5; %sample wave valuest0=0;tf=0.01;Ts=1e-6; %time vector and resolutionv=0;AmpPwm=1; %Pwm options, increase v for lower dutty-cyclet=t0:Ts:tf; %create the time vectorfun=AmpSin*sin(2*pi*f*t+a0); %create the functionpwm=AmpPwm*(fun>v); %get the pwm %plot it just to know if its workingclfplot(t,fun)hold onplot(t,pwm,'r')Alternative implementation in simulink Related QuestionObtaining signal units post compilationRelay block to generate signal PWMPWM signal generator and pulse rise timeSimulink: Obtaining propagated signal names programmatically
Best Answer