Answered
Assigning certain seed value to Simulink Uniform Random Number block in programmatic way
Hi JW, That looks like a typographical error in the doc (which is odd, I've always imagined stuff like that is generated automa...

2 years ago | 0

| accepted

Answered
Number of filter taps in Gaussian filter design
Hi Jay, The doc page for gaussdesign states "The number of symbols between the start and end of the impulse (span) and the num...

2 years ago | 0

| accepted

Answered
Inconsistency between the FFT results and the analytic spectrum of a Gaussian function
Hi Sherwin, fft assumes the input sequence starts at k = 0, so we have to apply ifftshift on the input to fft. fs = 10; t = -...

2 years ago | 1

| accepted

Answered
How to plug x^2+y^2 in to euler's Method
Hi Michael, Focusing only on the error message ... this line is the source of the error f(i) = x.^(2).*(i)+y.^(2).*(i); ...

2 years ago | 0

Answered
Solving symbolic third order polynomial
Hi Axel, What is the source for the equations in red? Here is Matlab's solution: syms q(t) a0 a1 a2 a3 q0 q1 dq0 dq1 t0 t1; ...

2 years ago | 0

Answered
How to identify transfer function of a motor with IODelay?
Hi Erik, Here's what I tried: Load the data load forum.mat Run the script so I can operate on the same variables. Take note ...

2 years ago | 1

| accepted

Answered
Solving symbolically for variables that are equal to several equations
Hmm. Don't know why solve doesn't find a solution, syms xi v r a mu spec_eng1 = [xi == (v^2)/2-mu/r, xi == -mu/(2*a)] solve(s...

2 years ago | 0

Answered
I am trying to get my function to return two variables to the workspace. It is a very simple function. What am I doing wrong.
If you want both outputs returned, use ouput arguments on the call [m,n] = save_13(1,2) When you call a function without outpu...

2 years ago | 0

Answered
Simulink - output of a block as an another block parameter
Hi Wiktor, Some Simulink blocks have parameters that can be specified either internally or externally, such as the Integrator b...

2 years ago | 0

Answered
Hello, I want to use the LPC function to achieve AR pre-whitening, will the AR coefficient obtained by fftfilt filtering signal is a residual signal?
Hello Yx Y, Based only on reading the lpc example, it would seem that the call to fftfilt should be xest = fftfilt([0 -a(2:end...

2 years ago | 0

| accepted

Answered
Using Fourier Series write a MATLAB function to synthesize the wave-form in problem (2-19), Assume A = 4mV. Your function should take n ( # of harmonics ) and produce a plot
Hi Evan First, check your code that defines one period of v(t). It''s probably easier to define v(t) using piecewise syms t T...

2 years ago | 0

Answered
Use of syms, piecewise & conv commands
Hi Ben, First you have to decide if you want to solve the problem for a closed form expression using symbolic tools, like syms ...

2 years ago | 0

| accepted

Answered
how to get the correct plot of function sin(N+1)*pi*x^2/sin(pi*x)^2 with different N
Hi Daniel, I think you are correct that the limit of y as x approaches any integer is (N+1)^2. However, all the compuations are...

2 years ago | 0

Answered
Repeat array onto the same row
A=[1,2,3,4] horzcat(A,A) horzcat(A,A(1:floor(numel(A)/2))) % or use ceils depending on how you want to handle the case where ...

2 years ago | 1

| accepted

Answered
How to plot FFT?
Hi Sara, The frequency vector needs to be corrected. And for this data it's helpful to subtract out the mean before taking the...

2 years ago | 0

| accepted

Answered
Fourier analysis of an spwm signal
Hi Mosharof, Load the data load spwm_one_cycle.mat Plot the differences between time samples. We see that the data is not equ...

2 years ago | 0

Answered
transform the cell 'string' containing strings into a single string
load string.mat who string string_new = join(horzcat(string{:})) Probably not a good idea to have a variable named string, w...

2 years ago | 1

Answered
Add zero padding to fft for accurate estimation
Hi Niusha Here is the first part of the code: Fs = 1e3; t = 0:0.001:1-0.001; x = cos(2*pi*100*t)+sin(2*pi*202.5*t); xdft = ...

2 years ago | 1

| accepted

Answered
calculate wrong or "/" work different
Hi pipor The ldivide, .\ and mldivide, \, which is what you're actually using here, for the scalar case are mathematically (tho...

2 years ago | 0

| accepted

Answered
How to get the eigenvalues of a transfer funciton matrix
Hi 宇航 杨, Considering that question 1 is about the "eigenvalues of a transfer function matrix", I would say that defining what t...

2 years ago | 0

Answered
Why does frequency spectrum gets flipped in STFT compared to the one generated from FFT?
Using random data rng(100); Matrix = rand(1000,1); Compute the stft [s,f,t] = stft(Matrix,5000/3,Window=rectwin(32),OverlapL...

2 years ago | 0

| accepted

Answered
Stability margins for a cascaded system with getLoopTransfer functions
Hi Daam, To get the stability margins at 'e', I believe this is correct: Le = getLoopTransfer(CL,'e',-1); % open-loop function...

2 years ago | 1

| accepted

Answered
Fourier transform of an impulse response function
Hi Jason, syms t tau f real % SYSTEM I'd use heaviside, but piecewise works too. h = piecewise(t>=0, 0.01005*(exp(-t))*si...

2 years ago | 0

Answered
I have 4 input channels (time series) and two output channels (time series) form test. I would like to calculate transfer function using tfestimate (MIMO).
Hi Dhiren, Have you tried the 'mimo' option of tfestimate (link to doc page) ?

2 years ago | 0

Answered
Does Error Message Depend on Whether or Not Function is Executed Inside Try/Catch?
I put in a service request to Tech Support on this question. Their answer was that the error that's returned to the user does, o...

2 years ago | 1

| accepted

Answered
Saving signals for each case of parsim() simulation
Hi TeraWatt, 1) Not sure what the issue is. I created a simple model with one logged signal. Ran the following script (R2022a)...

2 years ago | 0

Answered
Problems with the creation of a randomic signal
Hi Andrea, How are you defining the bandwdith? fs=200000; %sampling frequency B = 5000; %bandwidth rng(1); n = 1e4; % no...

2 years ago | 0

| accepted

Answered
Hello, I have problem with odeToVectorField in ODE second order system of equations.
The problem is confusion between sym expressions and symfun objects. g= 9.81; m= 0.468; Ix= 4.856e-3; Iy= 4.856e-3; Iz= 8....

2 years ago | 0

Answered
readmatrix error handling in Simulink Matlab function
Try using exist: function y = fcn(u) coder.extrinsic('exist'); fileexists = 100.0; % dummy assignment to specify fileexist...

2 years ago | 0

| accepted

Question


Does Error Message Depend on Whether or Not Function is Executed Inside Try/Catch?
This call to diff resolves to symbolic diff syms s diff(@(s) 1/(s+1),s) which diff(@(s) 1/(s+1),s) I guess the parser sees t...

2 years ago | 1 answer | 0

1

answer

Load more