Answered

How do I find the indices of NaN values in a cell array?

The below accounts for the possibility of multiple nan blocks. It does not, however, account for the possibility that the first...

How do I find the indices of NaN values in a cell array?

The below accounts for the possibility of multiple nan blocks. It does not, however, account for the possibility that the first...

11 minutos ago | 0

Answered

monts in year sequence, string, matrix

Convert to a timeseries() object and use retime() Or: Data = rand(365,1); Data_timestamp = datetime(2021, 1, 1:365).'; %use ...

monts in year sequence, string, matrix

Convert to a timeseries() object and use retime() Or: Data = rand(365,1); Data_timestamp = datetime(2021, 1, 1:365).'; %use ...

alrededor de 1 hora ago | 1

| accepted

Answered

Index exceeds matrix dimensions. in for loop !

for i=1:Np x(: , i+1) = f(x(: , i) , U(:,i)); That needs to access up to the Np'th column of U Cost ([1;1;1;1;1;1] , ...

Index exceeds matrix dimensions. in for loop !

for i=1:Np x(: , i+1) = f(x(: , i) , U(:,i)); That needs to access up to the Np'th column of U Cost ([1;1;1;1;1;1] , ...

alrededor de 2 horas ago | 0

Answered

Keeping track of the Index while using "cell2mat" function

key = cell2mat((arrayfun(@(IDX) [repmat(IDX, size(a{IDX},1), 1), (1:size(a{IDX},1).']) , 1:numel(a), 'uniform', 0)); Now index ...

Keeping track of the Index while using "cell2mat" function

key = cell2mat((arrayfun(@(IDX) [repmat(IDX, size(a{IDX},1), 1), (1:size(a{IDX},1).']) , 1:numel(a), 'uniform', 0)); Now index ...

alrededor de 2 horas ago | 0

| accepted

Answered

Can't plot a graph no matter what I do

if check1 == 1 && check2 ==2 && check3 ==1 elseif check1 == 1 && check2 ==2 && check3 ==1 Thoseare the same conditions...

Can't plot a graph no matter what I do

if check1 == 1 && check2 ==2 && check3 ==1 elseif check1 == 1 && check2 ==2 && check3 ==1 Thoseare the same conditions...

alrededor de 6 horas ago | 0

Answered

How can I code pseudo random binary sequence input current signal made by idinput?

When your functions use random numbers, such as your call to randn(), then they are never ODE (Ordinary Differential Equations)....

How can I code pseudo random binary sequence input current signal made by idinput?

When your functions use random numbers, such as your call to randn(), then they are never ODE (Ordinary Differential Equations)....

alrededor de 16 horas ago | 0

Answered

how to implement Bessel's function in MATLAB

https://www.mathworks.com/help/matlab/ref/besselj.html for the numeric version https://www.mathworks.com/help/symbolic/besselj....

how to implement Bessel's function in MATLAB

https://www.mathworks.com/help/matlab/ref/besselj.html for the numeric version https://www.mathworks.com/help/symbolic/besselj....

alrededor de 16 horas ago | 0

Answered

Not understanding the function input arguments

X_full (first paramter): A column vector of floating point data Y_full (second parameter): A column vector of floating point da...

Not understanding the function input arguments

X_full (first paramter): A column vector of floating point data Y_full (second parameter): A column vector of floating point da...

alrededor de 16 horas ago | 0

Answered

Define a collection of variables

mons = {'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'...

Define a collection of variables

mons = {'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'...

alrededor de 20 horas ago | 0

Answered

Issue with vectors being the same length

x1 = linspace(xa,xb,nn)'; x2 = linspace(xb,xc,nn)'; xx=[x1;x2]; so xx ...

Issue with vectors being the same length

x1 = linspace(xa,xb,nn)'; x2 = linspace(xb,xc,nn)'; xx=[x1;x2]; so xx ...

alrededor de 23 horas ago | 1

| accepted

Answered

Use arrayfun and cellfun to avoid for-loops

for i= 1:length(Categories)-1 for j= i+1:length(Categories) % separated_data is a 3D array of data, I ...

Use arrayfun and cellfun to avoid for-loops

for i= 1:length(Categories)-1 for j= i+1:length(Categories) % separated_data is a 3D array of data, I ...

alrededor de 23 horas ago | 0

| accepted

Answered

fmincon for bounded optimization problem

Generally speaking, functions without bounds can take indefinite time to minimize if the function has an asymptope | ...

fmincon for bounded optimization problem

Generally speaking, functions without bounds can take indefinite time to minimize if the function has an asymptope | ...

alrededor de 23 horas ago | 0

Answered

How to find a shortest path from a node to a sub-network?

https://www.mathworks.com/help/matlab/ref/graph.shortestpathtree.html TR = shortestpathtree(G,s,t) computes the tree of short...

How to find a shortest path from a node to a sub-network?

https://www.mathworks.com/help/matlab/ref/graph.shortestpathtree.html TR = shortestpathtree(G,s,t) computes the tree of short...

1 día ago | 0

| accepted

Answered

What is the Fourier Function of Matlab doing?

https://math.stackexchange.com/questions/1707452/what-is-the-fourier-transform-of-fx-x2 syms x w FT(w) = fourier(x^2, x, w) ...

What is the Fourier Function of Matlab doing?

https://math.stackexchange.com/questions/1707452/what-is-the-fourier-transform-of-fx-x2 syms x w FT(w) = fourier(x^2, x, w) ...

1 día ago | 0

Answered

Matrix and solve command, Why this is not working please help me.

You asked to solve two equations for a single variable. Except in some cases involving inequalities, you should ask to solve wit...

Matrix and solve command, Why this is not working please help me.

You asked to solve two equations for a single variable. Except in some cases involving inequalities, you should ask to solve wit...

1 día ago | 1

| accepted

Answered

complex value of syms function for optimization

syms a b c d ; b=c+j*d; Okay, b is a symbolic number that might or might not be complex. "might not be" because d could be 0, ...

complex value of syms function for optimization

syms a b c d ; b=c+j*d; Okay, b is a symbolic number that might or might not be complex. "might not be" because d could be 0, ...

1 día ago | 0

Answered

Converting a whole number to base 2 (Binary Operation)

Consider 19 as an example. 19 is odd, which is to say that the remainder when divided by 2 is 1. Write down the 1, subtract it ...

Converting a whole number to base 2 (Binary Operation)

Consider 19 as an example. 19 is odd, which is to say that the remainder when divided by 2 is 1. Write down the 1, subtract it ...

1 día ago | 0

Answered

importing the excel data into matlab in symbolic math tool

Your X is a vector with four elements. When you use it in the equations you are creating a system of four simultaneous equations...

importing the excel data into matlab in symbolic math tool

Your X is a vector with four elements. When you use it in the equations you are creating a system of four simultaneous equations...

2 días ago | 0

Answered

Creating Random Sparse Matrices Using For Loop

N = 100; S = 100; RM = cell(N,1); B = zeros(1,N); for K = 1 : N RM{K} = sprand(S, S, 0.01); B(K) = bandwidth(RM{K})...

Creating Random Sparse Matrices Using For Loop

N = 100; S = 100; RM = cell(N,1); B = zeros(1,N); for K = 1 : N RM{K} = sprand(S, S, 0.01); B(K) = bandwidth(RM{K})...

2 días ago | 0

Answered

Task,solving in the fastest way

how to get a solution the fastest Commercial quantum computers are available from DWave and IBM. HP expects to release its vers...

Task,solving in the fastest way

how to get a solution the fastest Commercial quantum computers are available from DWave and IBM. HP expects to release its vers...

2 días ago | 1

Answered

Simplifying solution of a differential equation

m = rand(); k = rand(); syms y(t) Dy = diff(y,t); Dy2 = diff(y,t,2); ode = m*Dy2 + k*y == 0; cond = [y(0) == 1,Dy(0) ==...

Simplifying solution of a differential equation

m = rand(); k = rand(); syms y(t) Dy = diff(y,t); Dy2 = diff(y,t,2); ode = m*Dy2 + k*y == 0; cond = [y(0) == 1,Dy(0) ==...

2 días ago | 0

| accepted

Answered

Image texture on face vertice 3D Model

If you have empty faces, then nothing can be drawn there. Perhaps you should use boundary() https://www.mathworks.com/help/matl...

Image texture on face vertice 3D Model

If you have empty faces, then nothing can be drawn there. Perhaps you should use boundary() https://www.mathworks.com/help/matl...

2 días ago | 0

Answered

Can anyone suggest how to change the display allignment in command prompt for seeing list of equations

syms x eq(1,1) = expand((x-1)^2); eq(2,1) = expand((x-1)^10); eq char(eq) arrayfun(@disp, eq)

Can anyone suggest how to change the display allignment in command prompt for seeing list of equations

syms x eq(1,1) = expand((x-1)^2); eq(2,1) = expand((x-1)^10); eq char(eq) arrayfun(@disp, eq)

2 días ago | 0

Answered

there is error in x1(t)

syms t t0 u(t)=piecewise(t<t0, 0, t>=t0, 1); x1(t)=2*u(t-1)-2*u(t-3); T = 0:1/50:10; X1 = double(subs(x1(T),t0,0)); plot(...

there is error in x1(t)

syms t t0 u(t)=piecewise(t<t0, 0, t>=t0, 1); x1(t)=2*u(t-1)-2*u(t-3); T = 0:1/50:10; X1 = double(subs(x1(T),t0,0)); plot(...

2 días ago | 0

| accepted

Answered

Changing value when first time a value appears

A=[1; 1; 1; 1; 2; 2; 4; 4; 4; 4] B=[4; 2; 7; 9; 5; 0; 2; 6; 1; 0] [~, ia] = unique(A, 'stable') B(ia) = nan

Changing value when first time a value appears

A=[1; 1; 1; 1; 2; 2; 4; 4; 4; 4] B=[4; 2; 7; 9; 5; 0; 2; 6; 1; 0] [~, ia] = unique(A, 'stable') B(ia) = nan

2 días ago | 1

| accepted

Answered

Function 'daysact' not supported for code generation.

Correct. That function cannot be compiled. The work-around is to use datetime and subtract. dt1 = datetime('7-sep-2002','Loca...

Function 'daysact' not supported for code generation.

Correct. That function cannot be compiled. The work-around is to use datetime and subtract. dt1 = datetime('7-sep-2002','Loca...

2 días ago | 0

Answered

How could I use display function for this?

If you mean the derivative as in then MATLAB does not have any direct way to display that in any kind of nice format. All it h...

How could I use display function for this?

If you mean the derivative as in then MATLAB does not have any direct way to display that in any kind of nice format. All it h...

3 días ago | 0

Answered

Newton Raphson. How to solve it?

If you are using the symbolic toolbox, then MATLAB has jacobian() Otherwise, you need to estimate the jacobian, which you can d...

Newton Raphson. How to solve it?

If you are using the symbolic toolbox, then MATLAB has jacobian() Otherwise, you need to estimate the jacobian, which you can d...

3 días ago | 0

| accepted

Answered

Can I delete the file mw_4a_config.bin from the licenses folder?

The implication of https://www.mathworks.com/matlabcentral/answers/367213-why-do-i-get-the-error-something-unexpected-occurred-a...

Can I delete the file mw_4a_config.bin from the licenses folder?

The implication of https://www.mathworks.com/matlabcentral/answers/367213-why-do-i-get-the-error-something-unexpected-occurred-a...

3 días ago | 0