Respondida
Integral from 0 to inf with imaginary numbers takes too long
Hi BOSHU Here is my attempt. syms Kt Ks Cs M m to % overwritten later syms x Assume t is real, is that a good assumption? ...

más de 3 años hace | 1

Respondida
How to make a simple plot with two lines?
Hi Macy, %table_a = readtable('Data1.xlsx'); table_a = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_fil...

más de 3 años hace | 0

| aceptada

Respondida
A matrix is passed into Simulink fromworkspace,Invalid workspace variable specified as workspace input in 'test03/From Workspace1'. Time values must be non-decreasing.
If img is a contstant matrix, don't use a From Workspace block. Instead, use a Constant block and set its 'Constant value' bloc...

más de 3 años hace | 2

| aceptada

Respondida
im trying to Find ∂z∂u when u=0, v=3, if z=sin(xy)+xsin(y), x=2u2+v2, and y=3uv.
Hi Matthew, Repeating the code from your comment clear; syms u v x y z ; %partial z z =sin(x*y)+(x*sin(y)); dzdx=diff(z,x)...

más de 3 años hace | 0

Respondida
A compact way to sum the elements contained in two cell arrays (considering the case of empty cells as well)
Would be easier if the first element of b weren't empty. Logic would need to be modified a bit if there is a possiblity that a c...

más de 3 años hace | 2

Respondida
How to convert symbolic output to numeric value in Symbolic Math Toolbox?
My first inclination was to stay symbolic all the way through and then compute numerical values at the end. syms lambda mu sigm...

más de 3 años hace | 0

| aceptada

Respondida
it says Error in result(i)=piecewise_function(x(i)); result(i)=piecew
What should result be if x < 2 or if x > 5?

más de 3 años hace | 0

Respondida
How to transform a second order ODE to the format xddot=A.X+B.U
Hi Ítalo, Let p = x and q = xdot. Then the standard, first order state space model is [pdot;qdot] = [zeros(n) eye(n); A zeros...

más de 3 años hace | 0

Respondida
get the space states matrix in terms of output
Hi Vermeer, Based on this comment it sounds like you might want to pursue model reduction techniques. The Control System Toolbo...

más de 3 años hace | 0

| aceptada

Respondida
Effect of zero padding on FFT amplitude
This thread started with one question about zero-padding the Discrete Fourier Transform (DFT) and the answers and comments broug...

más de 3 años hace | 2

Respondida
Pass input timeseries and block values into the sim command
Hi Yevgeniy Use a Simulink.SimulationInput object. More generally start from Run Simulations and follow the doc pages from ther...

más de 3 años hace | 0

| aceptada

Respondida
How to give a vector as input in Simulink, to solve a system of differential equations ?
Use a 1-D Lookup Table block with a Clock connected to its input. Use the y-array and its corresponding times to specify the ta...

más de 3 años hace | 0

| aceptada

Respondida
How to join matrices of different lengths into one mother matrix
Hi Joanne, If you want to store different size arrays in a single data structure you probably should consider using a container...

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

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

más de 3 años hace | 0

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

más de 3 años hace | 0

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

más de 3 años hace | 0

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

| aceptada

Respondida
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(...

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 1

| aceptada

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

más de 3 años hace | 0

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

más de 3 años hace | 0

| aceptada

Respondida
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))

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

| aceptada

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

más de 3 años hace | 0

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

más de 3 años hace | 0

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

más de 3 años hace | 0

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

más de 3 años hace | 1

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

más de 3 años hace | 0

Cargar más