Answered
Code error in MATLAB function block.
Insert y = zeros(size(u)); before the call to lowpass()

4 years ago | 0

Answered
Code involving factorials and a given value
Just generate factorial(1:18) and discretize() against it. Beyond 18, you would be dealing with integers larger than double prec...

4 years ago | 0

Answered
MATLAB Cloud. How to use if I have an Institution license
You need a Login Named User license for that purpose, which you should be able to do with your license. See https://www.math...

4 years ago | 1

Answered
How to integrate a vector after derivating it to interpretate original values?
You should use cumtrapz(), but be sure to pass in the sample period (regularly spaced signals) or the vector of times (irregular...

4 years ago | 0

| accepted

Answered
how to solve this differential equation system symbolically?
Create the symbols and the two equations. dsolve() the pair of equations *without* boundary conditions, getting out a struct wit...

4 years ago | 0

Answered
How to import functions without addpath
scripts (but not functions) can be accessed using run() including a directory. Functions must be on the path, or in a package...

4 years ago | 0

Answered
How to know the value on the coordinates that i circled at MATLAB Function? Like (0,Y)=3.57
You have a voltage vs current plot. Those are independent unless being forced by something external. The values are only going t...

4 years ago | 0

Answered
I am trying to plot a graph along an interval t [0,1] but I just can't get the plot function to work.
move the subs() to *after* the assignment to t

4 years ago | 0

Answered
matric component of symbolic fuction
There is no way to do that in MATLAB, at least not without knowing the internal operations of the Symbolic engine. In MATLAB ...

4 years ago | 0

Answered
Plotting With Arrays on Surf Function
Every iteration you are storing the exact same value Laptime, which never changes.

4 years ago | 0

Answered
In App designer, I am receiving this error using zpk and I don't know the reason.
You should not be using [app.Zeroes] you should be using {app.Zeroes} and likewise for the other two variables.

4 years ago | 0

Answered
Keep getting error using sound command
audioread() returns something that has one row per sample, and as many columns as there are channels. n = [-M/2:M/2]; That is ...

4 years ago | 0

Answered
How to find local minimum of fit polynomial
poly1 is of the form a*x+b for some model parameters a and b. The minimum of a straight line is: at the lower bound of x if a ...

4 years ago | 0

Answered
Reshape row vector with given number of column
A = [1,2,3,4,5,6] , col = 3 B = reshape(A, col, []).'

4 years ago | 1

| accepted

Answered
Why am I am facing this error "Index in position 1 is invalid. Array indices must be positive integers or logical values."
y1= @(t,y,z) -exp(-t).*y^2 %Write your f(x,t) function, where dy/dt=f(x,t) y2 = @(t,y,z) y.^2 -0.1*exp(-t).*z y1 and y2 are a...

4 years ago | 0

| accepted

Answered
I have an error with the plot3 function "vectors must be the same length"
The problem you had was that you were using the / operator. In MATLAB A/B means roughly the same as A * pinv(B) --- it does not...

4 years ago | 0

| accepted

Answered
fminsearch maximum number of iterations
I had to make guesses about the correct code. Your code has mu*/ in two places, but it is not valid to have */ mu = 0.0025; % ...

4 years ago | 1

| accepted

Answered
Same code but different results
MATLAB Online is one release newer (R2022a) MATLAB Online is Linux based, and uses different high-performance Math libraries th...

4 years ago | 0

Answered
Can a for statment contain a matrix
For vector Ns1: mask = Ns1 >= 2.2; Ns1diff = Ns1(mask) - 3.3; But is that useful? The Ns1diff variable here just contains inf...

4 years ago | 0

Answered
several minimum values on a vector
Provided you are dealing with a vector X = min(Z); Y = find(Z == X); Generalizing this to the case of arrays (2 or more dimen...

4 years ago | 0

Answered
How to Code Monte carlo simulation?
C(i,1) = Cs(i,1)[1-erf(Cd(i,1)/(2*sqrt(D(i,1)*T(i,1))))] You forgot the multiplication; MATLAB does not have implied multipli...

4 years ago | 0

Answered
plotting without straight lines connecting two intervals of data in a same day
Insert a nan into the both plot variables at that point. You could also use multiple nan there -- so you could insert a nan for...

4 years ago | 1

| accepted

Answered
Synthesizing signal given expression
First create a vector of times in t. Then x = 9 * cos(421*t + 1.99); stem(t, x)

4 years ago | 0

| accepted

Answered
Without using randi inbuilt function
Mathematically, the algorithm is lower_bound + floor((upper_bound - lower_bound) * rand(size_to_generate)) Taking into account...

4 years ago | 0

| accepted

Answered
How to find the input value when outputting the maximum value
[max_length, maxidx] = max(mi); switch maxidx case 1 coords = {A, B}; case 2 coords = {A, C}; ...

4 years ago | 0

| accepted

Answered
progressbar() issue, fails after one iteration
Each parameter to progressbar() corresponds to a different bar. You are creating two bars. You are updating two bars. But when y...

4 years ago | 0

| accepted

Answered
Why do I get the error "Undefined function 'fitrm' for input arguments of type 'table' " ?
You need the Statistics toolbox, R2014A or newer.

4 years ago | 0

| accepted

Answered
estimating parameters by lsqcurvfit
infected= data(1:12,2); You do that assignment once, before any function calls. You do call [B,resnorm,RESIDUAL,exitflag,OUT...

4 years ago | 0

Answered
Can't open anymore files with fopen above some threshold
There is a per-process limit on the number of open files, !ulimit -n The limit for the operating system running MATLAB Answer...

4 years ago | 0

Answered
how to plot curve that run from top left to bottom right
set(gca, 'ydir', 'reverse')

4 years ago | 0

Load more