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})...

3 days 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...

3 days 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) ==...

3 days 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...

3 days 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)

3 days 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(...

3 days 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

3 days 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...

4 days 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...

4 days 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...

4 days 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...

4 days ago | 0

Answered

Changing values in a table

No loop should be needed. X = M{:,cl1-1}; M{X == 1, cl1:cl2} = 1;

Changing values in a table

No loop should be needed. X = M{:,cl1-1}; M{X == 1, cl1:cl2} = 1;

4 days ago | 0

| accepted

Answered

How to Use "Ask a Question" Section Correctly?

Use shift-reload to load the page back in, which will update the cached version of the style sheets. You should only have to do...

How to Use "Ask a Question" Section Correctly?

Use shift-reload to load the page back in, which will update the cached version of the style sheets. You should only have to do...

4 days ago | 2

Answered

How to apply a matrix to a function?

No, there is no way to do that. When you create a symbolic function by assignment to a variable indexed with a list of symbols,...

How to apply a matrix to a function?

No, there is no way to do that. When you create a symbolic function by assignment to a variable indexed with a list of symbols,...

4 days ago | 0

| accepted

Answered

How to print full size figure using print command?

print() uses the figure PaperSize and PaperPosition properties to decide what size to output.

How to print full size figure using print command?

print() uses the figure PaperSize and PaperPosition properties to decide what size to output.

4 days ago | 0

| accepted

Answered

error: 'Inputs must be floats, namely single or double' while trying to solve an ODE having an unknown coefficient.

The function you call for ode*() is permitted to use symbolic expressions internally, but the return value must be completely nu...

error: 'Inputs must be floats, namely single or double' while trying to solve an ODE having an unknown coefficient.

The function you call for ode*() is permitted to use symbolic expressions internally, but the return value must be completely nu...

4 days ago | 1

| accepted

Answered

simple Equation, writing formula

Average is sum divided by two. You do not divide by two.

simple Equation, writing formula

Average is sum divided by two. You do not divide by two.

4 days ago | 0

| accepted

Answered

store the for result to txt file using dlmwrite

you need the -append flag to dlmwrite and you need to write in full rows, not one element at a time.

store the for result to txt file using dlmwrite

you need the -append flag to dlmwrite and you need to write in full rows, not one element at a time.

4 days ago | 0

| accepted

Answered

Using a Loop to read and store information?

http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F Or potentially you could use a datastore()

Using a Loop to read and store information?

http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F Or potentially you could use a datastore()

4 days ago | 0

Answered

Function inside function using lsqcurvefit

clear all;clc; Okay, so this is a script, not a function. x=[ ]; Ln1=x(1);Ln2=x(2); % necks length S1=x...

Function inside function using lsqcurvefit

clear all;clc; Okay, so this is a script, not a function. x=[ ]; Ln1=x(1);Ln2=x(2); % necks length S1=x...

4 days ago | 0

| accepted

Answered

How to assign voltage levels to bit-groups?

https://www.mathworks.com/matlabcentral/answers/714408-how-to-make-a-4-bits-quantizer-with-15-levels#comment_1258188

How to assign voltage levels to bit-groups?

https://www.mathworks.com/matlabcentral/answers/714408-how-to-make-a-4-bits-quantizer-with-15-levels#comment_1258188

4 days ago | 0

Answered

Why are these MATLAB Functions Called?

num2str() and int2str() should be replaced with sprintf() unless you need the behavior of automatically formatting arrays. I ...

Why are these MATLAB Functions Called?

num2str() and int2str() should be replaced with sprintf() unless you need the behavior of automatically formatting arrays. I ...

4 days ago | 0

Answered

plot field form a orderd vector

lat=[10,11,10,12,13,10] lon=[50,51,52,54,52,51] height=[10,50,120] wind_speed=[7,4,3,2,1,6 ; 8,6,5,4,5,9; 10,8,8,7,6,11] win...

plot field form a orderd vector

lat=[10,11,10,12,13,10] lon=[50,51,52,54,52,51] height=[10,50,120] wind_speed=[7,4,3,2,1,6 ; 8,6,5,4,5,9; 10,8,8,7,6,11] win...

5 days ago | 0

Answered

I tried to convert odes to ss but i have problem//odeToVectorField

Your code had some problems. You were not declaring v as a function. Your definition of eqn3 involved multiplying eqn2 by a v...

I tried to convert odes to ss but i have problem//odeToVectorField

Your code had some problems. You were not declaring v as a function. Your definition of eqn3 involved multiplying eqn2 by a v...

5 days ago | 1

| accepted

Answered

eulergamma throwing an 'Undefined function or variable' error

[Moving down from comment] You have the Maple symbolic toolbox interface to matlab installed. You need to uninstall that interf...

eulergamma throwing an 'Undefined function or variable' error

[Moving down from comment] You have the Maple symbolic toolbox interface to matlab installed. You need to uninstall that interf...

5 days ago | 0

Answered

ignore NaN values in loop

if isempty(A) CC(:,i) = nan; else A = interpft(A, 100); CC(:,i) = A; end Can interpft operate with only one no...

ignore NaN values in loop

if isempty(A) CC(:,i) = nan; else A = interpft(A, 100); CC(:,i) = A; end Can interpft operate with only one no...

5 days ago | 0

| accepted

Answered

Multiple for loops in explicit fashion with time step

No, there is not, only inefficient ways. https://www.mathworks.com/matlabcentral/answers/623358-get-a-combination-of-unique-pat...

Multiple for loops in explicit fashion with time step

No, there is not, only inefficient ways. https://www.mathworks.com/matlabcentral/answers/623358-get-a-combination-of-unique-pat...

5 days ago | 1

Answered

How do I generate code Matlab to make my work easier

tvals = [0.1 0.12 0.125 0.1225, 0.15]; numt = length(tvals); err = zeros(1, numt); for tidx = 1 : numt t = tvals(tidx); ...

How do I generate code Matlab to make my work easier

tvals = [0.1 0.12 0.125 0.1225, 0.15]; numt = length(tvals); err = zeros(1, numt); for tidx = 1 : numt t = tvals(tidx); ...

5 days ago | 0

| accepted

Answered

Exporting variable names and their respective data types to excel

You can get the MATLAB datatypes by using vt = reshape(varfun(@class, YourTable, 'outputformat', 'cell'), [], 1); [uvt, ~, g] ...

Exporting variable names and their respective data types to excel

You can get the MATLAB datatypes by using vt = reshape(varfun(@class, YourTable, 'outputformat', 'cell'), [], 1); [uvt, ~, g] ...

6 days ago | 0

Answered

numbers to the left of the dot in tab of matlab

The %e format always outputs exactly one digit before the decimal place, and outputs a number of decimal places after that accor...

numbers to the left of the dot in tab of matlab

The %e format always outputs exactly one digit before the decimal place, and outputs a number of decimal places after that accor...

6 days ago | 0

| accepted