Risposto
Numerical precision issues when using tf('s')
I thin the general recommendation is that zpk is superior to tf, and that ss is superior to both. See Using the Right Model Repr...

9 mesi fa | 1

| accettato

Domanda


How Do Assignment and Deletion Work with an Empty Index on the Left Hand Side ?
I've always thought that indexing with an empty array on the LHS of an = is a no-op for the variable on the LHS (there could be ...

9 mesi fa | 1 risposta | 0

1

risposta

Domanda


Must a Function be in Scope Before Creating a Handle to It?
The doc page Create Function Handle states: "Keep the following in mind when creating handles to functions: Scope — The functi...

9 mesi fa | 1 risposta | 1

1

risposta

Risposto
Different Output using For Loop vs Elementwise operation
x = linspace(0,pi,100); y = cos(x); This probably isn't what you want. Perhaps you mean z = zeros(size(x)) or something simila...

10 mesi fa | 0

| accettato

Risposto
Looking for an efficient way to run Simulink on thousands of independent files
If I'm understanding the workflow correctly, it seems like you could set up a loop to read in each mat file and set the appropri...

10 mesi fa | 0

| accettato

Risposto
Making random to work like randi
I wonder why makedist doesn't support Uniform Distribution (Discrete). But random can be called with that distribution. N_clus...

10 mesi fa | 1

| accettato

Risposto
Use case for eval that double/subs does not satisfy
Hi Stephen, Check out matlabFunction syms x1(t) x2(t) k12 k21 k20 k01 conds = [x1(0) == k01; x2(0) == 0]; eqn1 = diff(x1) ==...

10 mesi fa | 3

Risposto
Unexpected Perturbation of Constant Inputs During Full-System Linearization
Hi Gabriele, I wasn't able to create a simple model to replicate the problem, so I can't say for sure that what follows is 100%...

10 mesi fa | 0

Risposto
How to avoid redefining optimoptions in Simulink for real-time nonlinear optimization with fmincon (SQP)?
Are you really using a Matlab Function block? If so have you tried: function y = fcn(u) persistent options if isempty(opti...

10 mesi fa | 1

Risposto
How to correct numerical errors when using a chain of integrators in simulink
The initial conditions on the integrators need to be set to appropriate values to yield the expected result. Define the yellow ...

10 mesi fa | 1

| accettato

Risposto
How can I get the correct answer for int(1/x) with symbolic integration?
Seems like the OP might be missing a sign(x), though I'm not really sure how to intrepret this result. syms x real d = diff(lo...

10 mesi fa | 0

Risposto
SubSystem block does not have a parameter named 'MATLABFunction'
The function code in the Matlab Function block can be modified programatically using MATLABFunctionConfiguration

10 mesi fa | 0

Risposto
Question about entry-wise product of general plant and weighting function matrix using Hinfstruct for multi-objective design
Continuing the discussion from this comment .... To use hinfstruct using the entrywise multiplicaiton of T(s) and W(s), it seem...

10 mesi fa | 0

Risposto
Matrix multiplication bugged?
Hi Antonio, Multiplying a matrix by [1;0;0] on the right should return the first column of the matrix, which is exactly the res...

10 mesi fa | 1

Domanda


Do Symbolic simplify() and expand() of Expressions Involving nchoosek() Make Sense?
Define a simple nCk expression syms k integer e = nchoosek(2,k) Evaluate at some values. Evaluation for k<0 and k>2 returns 0...

11 mesi fa | 1 risposta | 0

1

risposta

Risposto
Result of symbolic definite integral is clearly wrong
Hi Dan, Add assumptions on variables, might help with simplifications. syms t real syms d integer syms k integer cutoff(t) ...

11 mesi fa | 1

Risposto
How to Control Simulink from Matlab during Simulation
Perhaps dashboard blocks would be helpful.

11 mesi fa | 0

Risposto
Simulink parameters change during simulation from Matlab cmd line
To be clear, the intent is to change at the command line, while the simulation is running, base workspace variables that are blo...

11 mesi fa | 0

| accettato

Domanda


Why Can an Anonymous Function be Defined with a Non-Existent Parameter?
Define an anonymous function with one argument (x) and one parameter (y) f = @(x) x + y; I'm suprised that line sails through ...

11 mesi fa | 1 risposta | 1

1

risposta

Risposto
How to write a timetable to excel with rowtimes as dates without times?
"If there was a way in Matlab to change the format in the first column in the excel file from "m/d/yy hh:mm" to "d-mmm-yyyy", my...

11 mesi fa | 0

Risposto
Matlab sorting numbers oddly
Hi Elijah, Would be helpful if you showed the code for reading the files. If I'm understanding correctly, maybe you could use ...

11 mesi fa | 0

Risposto
Zero-Padding Position for FFT
Hi Jason, The data in x can't span exactly -0.5*T to 0.5*T if it has an even number of uniformly spaced samples. Assuming the ...

11 mesi fa | 0

| accettato

Risposto
How To Handled Fixed Point Datatype in Simulink if I am Not Having Fixed Point Designer Licence?
Hi Anup, If by "handle fixed Datatype" you mean that you have to work with a model that uses fixed-point functionality, check o...

11 mesi fa | 0

Risolto


Generate a vector like 1,2,2,3,3,3,4,4,4,4
Generate a vector like 1,2,2,3,3,3,4,4,4,4 So if n = 3, then return [1 2 2 3 3 3] And if n = 5, then return [1 2 2 3 3 3 4...

11 mesi fa

Discussion


Answers Acting Flaky?
For the last day or two, I've been getting "upstream" and other various errors on Answers. Seems to come and go. Anyone else hav...

11 mesi fa | 0

Risposto
Shading area between 2 curves (x function in terms of y)
Here are the plots of the functions. The independent variable is y, which spans the x-axis on the fplot syms x y x1=y^2; x2=y...

11 mesi fa | 0

| accettato

Risposto
Indexing vectors with a zero and creating a "predicted" vector knowing what the diff should be
This solution is similar in spirit to that in this comment, which I think is the best approach based on how the problem has been...

11 mesi fa | 0

| accettato

Risposto
How can I plot 10 shifted single impulses in one plot (in a row)?
imp = @(x) sech(x); S0 = @(x) imp(x).*(x<=0); % assumes S0(0) = sech(0) ub = 10; x_imp = linspace(-ub, ub, 1001); x_S0 =...

11 mesi fa | 1

| accettato

Risposto
The sine wave comes out as flat as flat line .
The yellow line likely isn't flat, it just looks that way becuase the y-axis is scaled by 10^15. Try sending the that signal to ...

11 mesi fa | 2

Risposto
Simulink Matlab Fcn, logical error for incrementation in Goertzel's algorithm
Hi bieron surya, Every time the function executes it hits the line count = single(0); which does exactly what it says, i.e., ...

11 mesi fa | 0

| accettato

Carica altro