Answered
Input and Output Arguments
If you were to use a non-anonymous function to do that, then the function would have to use evalin('caller') and assignin('calle...

4 years ago | 0

Answered
How to plot a dot on a function line with only 1 value
plot(x, y, '-', 0, 4, 'bo')

4 years ago | 0

Answered
solving a system of equation using symbolic expressions returns empty solution
syms CG0 HC R T K0 Cm0 beta syms RH q_H2O CG K Cm HK eq1 = q_H2O == Cm * CG*K*RH / ((1-K*RH)*(1+(CG-1)*K*RH)); eq2 = C...

4 years ago | 0

| accepted

Answered
In spite of being real, I get the error: Warning: Imaginary parts of complex X and/or Y arguments ignored.
dNis = Nis - Nth; Ais = sqrt((AInj^2 - gammaN/gammaP*dNis)/(1 + g*dNis/gammaP)); dNis is negative. That makes the numerator f...

4 years ago | 0

Answered
Error using symengine, Too many input arguments, x= xf; fx = funfcn(x,varargin{:});
with those constants, f_sym is (y*y + y + 1)/(y*y+y+1) which is 1 except at 0. derivative of 1 is 0... with no symbolic variable...

4 years ago | 1

| accepted

Answered
How to avoid error in anonymous function
f = @(x, u) Fx(x,u)*x(t-1) + Fu(x,u)*u(t-1);

4 years ago | 0

Answered
Continuous Errors Trying to Solve for an 11-State Variable w/ ODE45
-(-1200*diff(a1*sin(omega1*t)) omega1 is a scalar constant. At any instant in an ode45() call, t is a scalar value. omega1*t is...

4 years ago | 0

Answered
Why does my plot go blank when I run my program?
for i=1:length(theta2(i)) At the point in your code where you are constructing the bounds of the for loop, the bounds to the ri...

4 years ago | 0

Answered
Why is 0 and 30 1/2?
heaviside(X) by default has a value of 1/2 when X has a value of 0 The Heaviside function does not have a well-defined value at...

4 years ago | 0

| accepted

Answered
containers.Map: The number of keys and values must be the same
valueSet = {DS.CarNum};

4 years ago | 1

| accepted

Answered
Create Diary in a function?
Return RAII from the function. Your onCleanup will not fire until the struct stops existing.

4 years ago | 0

| accepted

Answered
Create a highscore im matlab GUI video game
You can store the high score in a file. Test if the file exists and if so load the previous high score information. Each time a ...

4 years ago | 1

Answered
Updating plot in loop takes increasing amount of time
Use animatedline()

4 years ago | 2

| accepted

Answered
How to use if statement inside a for loop?
for i = 2:10 plot(x(:,25+i)) ; hold on dif(:,i) = x(: ,25+i) - x(:,25+(i-1)); mask = dif(:, i) > 200 if a...

4 years ago | 0

| accepted

Answered
Fmincon too many input arguments
You named your own function fmincon.m and at line 18 of that file you have a call to fmincon. You intended that the Mathworks fm...

4 years ago | 0

| accepted

Answered
Doc command doesn't work
You have a third party product installed that defines its own strjoin. Most likely culprit would be SPM12 which if I recall c...

4 years ago | 1

| accepted

Answered
Does matlab support differential equations including derivatives of two variables;I mean for example two differential equations dy/dx or d2y/dx2,dy/dt,dz/dt,dz/dx,d3z/dx3.
Those are partial differential equations, which are not supported by ode*() routines. You need the functions in the PDE Toolbox ...

4 years ago | 0

| accepted

Answered
Dot indexing is not supported for variables of this type. - trying to create a function to upload files matrices
function [signal, time, signal_reference, time_reference] = read_transmission(name) data = load([name '.mat']); sig...

4 years ago | 0

Answered
Image looks different from two similar calls to imread()
png files can hold uint8, uint16, and black and white (logical) images. Your png files are not consistent about their representa...

4 years ago | 0

Answered
set range to output file
mask = Row >= 2 & Row <= 4; Row(mask)

4 years ago | 0

| accepted

Answered
I'm looking to create a program for a second order DE and I'm getting this error.
f=[y(2);-7*y(1)-y(2)/2]; That code looks up the current values of y, does indexing, calculates specific numeric values, and...

4 years ago | 0

| accepted

Answered
Stuck at Gauss-Newton Method code
your j 2 is the derivative with respect to x, but you need it to be the derivative with respect to a1 which is a0*x*exp(-a1*x)

4 years ago | 1

Answered
NaN at (5,0) in graph. How to change it? Electric field
Etot = sqrt(Er_x.^2 + Er_y.^2); u = Er_x ./ Etot; What happens if Etot is 0 because Er_x and Er_y are both 0? 0/0 is... ...

4 years ago | 0

Answered
I am getting error in this imread statement. I don't know where it's wrong, please help, thanks
You pressed the Run button to execute the code. When you press the Run button, MATLAB executes the code with no parameters, and ...

4 years ago | 0

Answered
Cell in table data type conversion
a = (1:3)'; b = {'yes', 'no', 'yes'}'; t = table(a,b) t.b = cellfun(@(b) length(b) == 3, t.b)

4 years ago | 0

Answered
How can I store the values of a diagonal using only a for loop?
If you loop from 1 to the minimum of the number of rows or columns, then for iteration K the element is at d(K,K) If you want t...

4 years ago | 0

| accepted

Answered
Ga does not find the optimal value
You have 3 variables, each of which can only be the integers 2, 3, or 4. That is only 3^3 = 27 possibilities. Just run all of t...

4 years ago | 0

| accepted

Answered
How can I add a time stamp to a variable name?
warpedCBCT = strcat('warpedCBCT', datestring); savestruct = struct(warpedCBCT, DataToSave); [atlasFile, filepath] = uiputfile(...

4 years ago | 0

Answered
How to obtain the eigenvalues when I get the warning that the matrix is singular?
% A I = eye(2) m1 = [7 3; 3 -1] syms Lamda % The value for λ % B LaI = I * Lamda % Identity ma...

4 years ago | 0

Load more