Beantwortet
Simulink Goto block to a constant value
Connect a Constant block to the input of the Q_ave1 Goto block? If that's not the solution, please clarify what the goal is and...

mehr als 3 Jahre vor | 0

Beantwortet
How can I put conditional setting (if/else) on switch case block in Simulink?
Hi Gabryella, Please clarify the question. This logic: case 1 - if u1 >=20 case 2 - elseif u1 <= 20 works when u1 is a sca...

mehr als 3 Jahre vor | 0

Beantwortet
solve - unable to find explicit solution
Hi Alexei, Try to use isolate instead of solve to get an expression for X(s). Also, make sure to take the ilaplace of X(s), no...

mehr als 3 Jahre vor | 0

Beantwortet
How to generate a set of gaussian noise signal with zero mean and say 'x' variance and measure their covariance?
Check out normrnd, mvnrnd and cov. If you try those, or anything else, and can't get the code to work, feel free to post back s...

mehr als 3 Jahre vor | 0

Beantwortet
Monte Carlo simulation with two random variables with correlation
Because Qd and Qg are normal, perhaps mvnrnd is all that's needed.

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
The 'ss' class does not support code generation.
Hi Bavly, The only two lines in that function (it would be better if you pasted in text, rather than a screen capture) that are...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
use compose caculate piecewise fun
Hi jin, Perhapse I misunderstand the question, but the results all seem to be functionally equivalent. syms x f(x)=piecewise(...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Is there a way to get MATLAB Function name defined in Simulink block programmatically ?
Finding the function line is easy because it's the first line that starts with "function". Just need to deal with the different ...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
Problem with undefined function
logncdf is a function in the Statistics and Machine Learning Toolbox. That toolbox needs to be installed and it will have to be...

mehr als 3 Jahre vor | 0

Beantwortet
Solve 1D equation in simulink
Hi gdz, Assuming vpasolve needed because a closed form solution can't be found .... Can always try using an Algebraic Constrai...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to simply rearrange a symbolic equation to get an expression for one variable in terms of others
Not sure about solve, but isolate seems to work syms x(t) a eqn1 = x(t) == a + x(t)/2; isolate(eqn1,x(t))

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
Extract operations from symbolic expression
Hi Cedric What's the objection to using a Matlab Function block? If that wasn't a constraint, you could use matlabFunctionBlock...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
A question about SkyHogg model in Aerospace Blockset
Hi Islam I agree with your equation for alphadot, but not the notation. By standard convention (at least what I'm familiary wit...

mehr als 3 Jahre vor | 0

Beantwortet
How to solve optimization problems when the objective function includes a symbolic function
Hi @NJ2Cali I was able to get fmincon to run to completion using an objective function that uses syms. I changed Func2 to some...

mehr als 3 Jahre vor | 0

Beantwortet
How to interpret results of FFT/DFT?
By my calculations, if that sine wave is supposed to be 4.82 kHz, then the sampling frequency must be Fs = 1928000 Hz and the ...

mehr als 3 Jahre vor | 0

Beantwortet
Why results of the 'solve' are wrong?
Hi ruiheng, I would stay out of the double world to first make sure everything is working as expected. p_max=715.685424949238;...

mehr als 3 Jahre vor | 1

Beantwortet
Inverse Laplace plot error
Hi PTK, f1 is a symfun, so you could use fplot, or you could evaluate it at bunch of points and convert to double and the use p...

mehr als 3 Jahre vor | 0

Beantwortet
How to speed up a 2D interpolation in MATLAB?
A single call to interp2 should do the trick Position0 = 1:4; Velocity0 = 1:5; Output0 = Position0.' + Velocity0; RawPositio...

mehr als 3 Jahre vor | 0

| akzeptiert

Frage


Should sinc() be Implemented with sinpi()?
Here are the relevant lines that implement sinc dbtype sinc.m 24:27 Should line 26 now be implemented with sinpi? If concerne...

mehr als 3 Jahre vor | 1 Antwort | 0

1

Antwort

Beantwortet
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...

mehr als 3 Jahre vor | 0

Beantwortet
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...

mehr als 3 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 3 Jahre vor | 0

Beantwortet
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...

mehr als 3 Jahre vor | 0

Beantwortet
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...

mehr als 3 Jahre vor | 0

Beantwortet
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 ...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 3 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 3 Jahre vor | 0

Beantwortet
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; ...

mehr als 3 Jahre vor | 0

Beantwortet
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...

mehr als 3 Jahre vor | 2

Beantwortet
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...

mehr als 3 Jahre vor | 0

Mehr laden