Answered
FRD MIMO plant closed loop control, incorrect response
Define the controller fs = 5000; ts = 1/fs; g = 0.5; wp = 76.9*2*pi; d = 0.3; den = [1/wp^2 2*d/wp 1]; Ctot = tf({0 0 0 0...

4 years ago | 0

Answered
periodogram for 200 Hz sample rate returns 129 array length
Hi sam, signal = linspace(0,3000,200)'; %this is 1 second of my signal (200 because that's the sample rate) [x,y] = periodogra...

4 years ago | 1

| accepted

Answered
simulink add block wrong output
Hi 기범 I think the issue here is mixing together different fixed point data types. Using R2021b Here's the model, with the data...

4 years ago | 0

Answered
Generating signal from weibull distribution
Hi Davide, The functions wblpdf and wblrnd are both eligible for code generation, so you can call either from inside a Matlab F...

4 years ago | 0

Answered
Block callback function in Simulink model cannot access workspace variable when executed with parsim
Hi David, I think there is relatively straightforward solution to the original Question (I realize you found an alternative sol...

4 years ago | 0

Answered
Area in a normalpdf
x1 = [-4:.1:4]; y1 = normpdf(x1,0,1); x = [-4:0.1:-1.5]; plot(x1,y1) hold on area(x,normpdf(x,0,1)) See area for options ...

4 years ago | 0

| accepted

Answered
Trouble with MuPad when evaluating symfun at a symbolic variable instead of a number in MATLAB
Hi Nathaniel, I too could not figure out how to specify cond2 the way you want. A workaround would be to only specify cond1, a...

4 years ago | 0

| accepted

Answered
Model stop function callback cannot recognise variable when running with parsim
Having all the variables in the base workspace, using sim('mymodel'), and using the StopFcn works fine because in that case Stop...

4 years ago | 0

Answered
Drawing a line through the peak of the plot
m = 4.48e-26; % mass of Nitrogen molecule k = 1.38e-23; % Boltzmann Constant p = 0:2800; ind = 1; for T = 300:500:1500; ...

4 years ago | 0

Answered
The real() command outputs a complex number (doesn't appear to change it).
In syms world, use isAlways to determine if an expression or variable is real, etc. syms x isAlways(in(x,'real')) assume(x,'r...

4 years ago | 2

Answered
Using Matlab perform the convolution of the following signals of different duration and energy
Hi Ali, Assuming S1, S2, and S3 are continuous-domain signals, I think it would be better to compute the convolution integral u...

4 years ago | 0

Answered
unexpected matlab operator error when plotting from a simulink matlab function
Hi Edoardo, Are you really trying to plot u vs. u? Wouldn't that just be a straight line? If I understand what you're trying ...

4 years ago | 0

Answered
Convert string array to numetric.
If the data only contains 0's and 1's .. data = [ "01" "01" "10" "10" ...

4 years ago | 1

Answered
What is the Memory Block actually useful for?
Hi Islam, Memory blocks are often used to remove algebraic loops. The doc talks about this concept, just do a search. Here's a ...

4 years ago | 1

| accepted

Answered
Using Simulink from .m file
Ok. If F and Ma are constants, you should consider using a Constant block for each. Make the "Constant value" paramter F and Ma...

4 years ago | 1

| accepted

Answered
Can MATLAB function blocks be set to run once per simulation instead of each time step if the outputs are used as inputs to a 1D look-up table?
That link includes three different solutions, not sure which one you're using. Having said that, not sure how the error message ...

4 years ago | 0

| accepted

Answered
Zero order hold for signal reconstruction
Perhaps set the method input to interp1 to 'previous'.

4 years ago | 0

| accepted

Answered
How to access the values of sym?
Not sure why feval is used. Just using solve with ReturnConditions solves for the range of b that satisfies both inequalities. ...

4 years ago | 0

Answered
Simulink SImulation Inputs and Model Variables
Instead of using the StopFcn, maybe you can use setPostSimFcn functionality

4 years ago | 0

| accepted

Answered
How to extract number of matrices with all elements zero and the indexes of those matrices in a struct
Hi Abdullah, The Question use the term "cell" but it looks like the data only uses structures. If that's the case, then .... C...

4 years ago | 0

Answered
Finding the modulus margin for three different open loop systems through matlab?
Hi Yarno, I'm not aware of any function that will compute the modulus margin (which is too bad). But one way to get what should...

4 years ago | 0

| accepted

Answered
Sinusoidal Frequency Response of a Transfer Function
If the system were bounded-input-bounded-output (BIBO) stable, then the steady state output in response to input y(t) = A*sin(w*...

4 years ago | 0

Answered
cos block error (simulink)
Base Simulink doesn't have a block that implements functions cosd or cospi. Maybe some other toolbox does. If not, both of tho...

4 years ago | 0

Answered
I cannot call parameter value from workspace to Simulink matlab function block
Hi @mg Make the function like this: function y = AAA( var1,param1) BB= var1 CC = param1 * BB y=CC Then, follow t...

4 years ago | 0

Answered
Lsim function returns an array filled with Nan
Hi Gabriel, Recheck the model. As written it has two unstable poles way out in the right half plane. That will be very difficul...

4 years ago | 0

Answered
How to get a minimal realization of the syms based expressions?
Hi Aditya Have you considered converting TF to an lti system object? Better yet, is there really a need to use symbolic math a...

4 years ago | 0

| accepted

Answered
How to implement a look up table in simulink which can accept variable SIZE data as inputs
@Ganesh Iyer Accroding to the doc, the LUT Dynamic block doesn't accept variable size signals. I tried the following approach,...

4 years ago | 2

| accepted

Answered
Solving system of 2 non linear equations
syms x y real eq1 = 0.00014/(3.85E-05*cos((x-y)*0.006))-(0.196*0.026*tan((x-y)*0.0062)*tanh(x*0.026))/0.006+0.196-0.00014/3.85E...

4 years ago | 0

| accepted

Answered
Inverse Z-Transform of F(z) How to set ROC?
No, we can't specify the ROC for iztrans, which always assumes the time domain sequence is causal. Same issue with ilaplace. Ho...

4 years ago | 0

Answered
Riemann Siegel Theta Equation
Hi bil, Is this what you're looking for? syms t real theta(t) = angle(gamma(sym(1)/sym(4) +1i*t/2)) - log(sym(pi))/2*t tsol ...

4 years ago | 1

| accepted

Load more