Answered

All possible combinations of a number of an array

a = [ 1 2 3]; ua = unique(a); nua = length(ua); assert(nua <= 36, 'Sorry, this code only supports up to 36 elements in...

All possible combinations of a number of an array

a = [ 1 2 3]; ua = unique(a); nua = length(ua); assert(nua <= 36, 'Sorry, this code only supports up to 36 elements in...

environ 11 heures ago | 0

| accepted

Answered

How to deleted Enter char

a = regexprep(a, '[\r\n]', '') or a(ismember(a, [10 13])) = ''; %10 is newline, 13 is carriage return

How to deleted Enter char

a = regexprep(a, '[\r\n]', '') or a(ismember(a, [10 13])) = ''; %10 is newline, 13 is carriage return

environ 12 heures ago | 0

Answered

What is the problem for the following code?

h = input('\nEnter step size (h) = ') x(1) = input('\nx0 = '); You need a comma or a semi-colon between those two commands. Be...

What is the problem for the following code?

h = input('\nEnter step size (h) = ') x(1) = input('\nx0 = '); You need a comma or a semi-colon between those two commands. Be...

environ 12 heures ago | 0

Answered

'deal' doesn't distribute the elements of a calculated array out of cellfun

deal has never done that for any kind of variable. You are calculating a single vector in the cellfun, so your code with deal()...

'deal' doesn't distribute the elements of a calculated array out of cellfun

deal has never done that for any kind of variable. You are calculating a single vector in the cellfun, so your code with deal()...

environ 13 heures ago | 0

Answered

How to drop small terms in symbolic expression?

I was sure that I had posted code for this at one point, but I cannot find it. threshold = 1e-10; syms A E I R M = (sym('3.7e...

How to drop small terms in symbolic expression?

I was sure that I had posted code for this at one point, but I cannot find it. threshold = 1e-10; syms A E I R M = (sym('3.7e...

environ 13 heures ago | 0

Answered

Index in position 1 exceeds array bounds (must not exceed 1) -- cannot fix behavior script

When you load() and assign the output to a variable, the result is a struct with one field for each variable loaded. clickstr =...

Index in position 1 exceeds array bounds (must not exceed 1) -- cannot fix behavior script

When you load() and assign the output to a variable, the result is a struct with one field for each variable loaded. clickstr =...

environ 14 heures ago | 0

Answered

How do I reference a previous cell in a table?

fillmissing(YourTable, 'previous')

How do I reference a previous cell in a table?

fillmissing(YourTable, 'previous')

environ 14 heures ago | 0

Answered

Error: Index exceeds the number of array elements (0) on the linspace function

ftime3=linspace(Uhrzeit(1),Uhrzeit(end),height(freqbereich3)); If Uhrzeit is empty then Uhrzeit(1) would be out of ...

Error: Index exceeds the number of array elements (0) on the linspace function

ftime3=linspace(Uhrzeit(1),Uhrzeit(end),height(freqbereich3)); If Uhrzeit is empty then Uhrzeit(1) would be out of ...

environ 14 heures ago | 0

Answered

Removing specific cell values from a table

I was wondering if there was any way I could just mark those empty cells as unnecessary for doing the calculation? No, you cann...

Removing specific cell values from a table

I was wondering if there was any way I could just mark those empty cells as unnecessary for doing the calculation? No, you cann...

environ 15 heures ago | 0

Answered

How to make weekdays axis?

ax2.XAxis.TickLabelFormat = 'eee'; %or 'eeee'

How to make weekdays axis?

ax2.XAxis.TickLabelFormat = 'eee'; %or 'eeee'

environ 16 heures ago | 0

Answered

How to change axis size without affecting bin size

[Zf_S, Zf_L] = cellfun(@(B) bounds(B, 'all'), Zf); Zf_max = max(Zf_L); Zf_min = min(Zf_S); Zf_vals = linspace(Zf_min, Zf_max,...

How to change axis size without affecting bin size

[Zf_S, Zf_L] = cellfun(@(B) bounds(B, 'all'), Zf); Zf_max = max(Zf_L); Zf_min = min(Zf_S); Zf_vals = linspace(Zf_min, Zf_max,...

environ 16 heures ago | 0

Answered

How to spearate the output of vl_hog() into 6*6*31 blocks and use reshape() to convert every block to a row vector?

If you have a cell array of blocks, then vector_blocks_cell = cellfun(@(B) reshape(B,1,[]), non_vector_blocks_cell, 'uniform', ...

How to spearate the output of vl_hog() into 6*6*31 blocks and use reshape() to convert every block to a row vector?

If you have a cell array of blocks, then vector_blocks_cell = cellfun(@(B) reshape(B,1,[]), non_vector_blocks_cell, 'uniform', ...

environ 16 heures ago | 0

Answered

How do I keep the number of bins used the same when generating a histogram along with how do I illustrate its depth with color?

You are keeping the number of bins the same for the two histograms. The bins just are not aligned between the two plots, and you...

How do I keep the number of bins used the same when generating a histogram along with how do I illustrate its depth with color?

You are keeping the number of bins the same for the two histograms. The bins just are not aligned between the two plots, and you...

environ 16 heures ago | 0

Answered

Convert state-space representation (MIMO) to transfer function matrix

https://www.mathworks.com/help/matlab/ref/ss2tf.html But if you have an existing ss system created with https://www.mathworks....

Convert state-space representation (MIMO) to transfer function matrix

https://www.mathworks.com/help/matlab/ref/ss2tf.html But if you have an existing ss system created with https://www.mathworks....

environ 20 heures ago | 0

Answered

computer shut down when run

You have a script that calls @myfunc1 . And then you have function main and inside that function you have function myfunc...

computer shut down when run

You have a script that calls @myfunc1 . And then you have function main and inside that function you have function myfunc...

environ 20 heures ago | 0

Answered

i am geting error in this line why Error: File: dfdddd.m Line: 32 Column: 89 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

t_ind1(ii) =(3 * v_th^2 * r2)./((w_sync.*s(ii).*((r_th+(r2./s(ii)).^2 + (x_th+x2)^2)); 1 0 1 0 12 ...

i am geting error in this line why Error: File: dfdddd.m Line: 32 Column: 89 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

t_ind1(ii) =(3 * v_th^2 * r2)./((w_sync.*s(ii).*((r_th+(r2./s(ii)).^2 + (x_th+x2)^2)); 1 0 1 0 12 ...

environ 20 heures ago | 0

| accepted

Answered

Putting specific values to a matrix

https://www.mathworks.com/help/matlab/ref/perms.html values = [1 2 3]; perms(values)

Putting specific values to a matrix

https://www.mathworks.com/help/matlab/ref/perms.html values = [1 2 3]; perms(values)

environ 20 heures ago | 0

Answered

please show me how to use 'line commander'

u=line(x,y,'Color','k','LineWidth',2);

please show me how to use 'line commander'

u=line(x,y,'Color','k','LineWidth',2);

1 jour ago | 0

Answered

Error in plotting the waves.

You initialize y1_rec and y2_rec to all zero, and you assign 0 to y1_rec(1) and y2_rec(1), but you never assign anything non-zer...

Error in plotting the waves.

You initialize y1_rec and y2_rec to all zero, and you assign 0 to y1_rec(1) and y2_rec(1), but you never assign anything non-zer...

1 jour ago | 0

Answered

why is there an error in line 13 of my coding ?

Lfsl = 10*log((((3*10^8)./f)).^2)/((4*pi)^2).*d.^2; % finding free space loss

why is there an error in line 13 of my coding ?

Lfsl = 10*log((((3*10^8)./f)).^2)/((4*pi)^2).*d.^2; % finding free space loss

1 jour ago | 0

Answered

Help with while loop

dt = input('Enter the desired time step: '); while dt >= h^2 / (4*alpha) fprintf('solution is unstable\nPlease enter a val...

Help with while loop

dt = input('Enter the desired time step: '); while dt >= h^2 / (4*alpha) fprintf('solution is unstable\nPlease enter a val...

1 jour ago | 1

Answered

Query regarding finding the index which will give 90% of the total area under the curve

A = cumtrapz(x, y); x_idx = find(A >= 0.9 * A(end), 1);

Query regarding finding the index which will give 90% of the total area under the curve

A = cumtrapz(x, y); x_idx = find(A >= 0.9 * A(end), 1);

1 jour ago | 1

| accepted

Answered

Piecewise to Heaviside problem

syms f(x) t f(x) = piecewise(x<0, 0, 0 <= x & x < 2, x^2 - 1, 2 <= x & x < 5, 2*x - 3, 5 <= x, sin(x)); f(t) sympref('Heavisi...

Piecewise to Heaviside problem

syms f(x) t f(x) = piecewise(x<0, 0, 0 <= x & x < 2, x^2 - 1, 2 <= x & x < 5, 2*x - 3, 5 <= x, sin(x)); f(t) sympref('Heavisi...

1 jour ago | 1

Answered

why do I have an error on the length function?

You do not have an error on the length function. You have an error on the lenght function. length <- what you want lenght <...

why do I have an error on the length function?

You do not have an error on the length function. You have an error on the lenght function. length <- what you want lenght <...

1 jour ago | 1

Answered

how to overcome error: Index in position 1 is invalid. Array indices must be positive integers or logical values.

alpha=0.1:0.1:1; When you multiply by 10 you do not always get integers. 0.1 does not have an exact representation in finit...

how to overcome error: Index in position 1 is invalid. Array indices must be positive integers or logical values.

alpha=0.1:0.1:1; When you multiply by 10 you do not always get integers. 0.1 does not have an exact representation in finit...

1 jour ago | 0

Answered

how to plot a function symbolically?

You have 3 independent variables and 1 dependent variable. You will need a 4D plot. Unfortunately: # there are no symbolic 4d...

how to plot a function symbolically?

You have 3 independent variables and 1 dependent variable. You will need a 4D plot. Unfortunately: # there are no symbolic 4d...

1 jour ago | 0

Answered

Please convert this c program into matlab code

That code cannot be converted to MATLAB: it depends on standard input for reading from the user, but MATLAB does not have standa...

Please convert this c program into matlab code

That code cannot be converted to MATLAB: it depends on standard input for reading from the user, but MATLAB does not have standa...

1 jour ago | 0

Answered

How I can write this equation in matlab codes?

Use a vector calculation to calculate the entries inside the summation -- there are only 9 of them. Then sum() them. abs() and s...

How I can write this equation in matlab codes?

Use a vector calculation to calculate the entries inside the summation -- there are only 9 of them. Then sum() them. abs() and s...

1 jour ago | 0

Answered

I am a beginner, can anyone please help me writing a code for this equation to find 'x' using iteration

That looks like homework. syms x lhs = 1 + sym(4.56)^2/sym(40)^2; rhs = gamma(1+2/x) / gamma(1+1/x)^2 fplot([lhs-rhs,0], [-2...

I am a beginner, can anyone please help me writing a code for this equation to find 'x' using iteration

That looks like homework. syms x lhs = 1 + sym(4.56)^2/sym(40)^2; rhs = gamma(1+2/x) / gamma(1+1/x)^2 fplot([lhs-rhs,0], [-2...

1 jour ago | 0

Answered

Converting strings to operators

S = '(2*3)+Z*14*(3*5)+(7)*(9)-(11)*13' while true newS = regexprep(S, {'\((\d+)\)\*\((\d+)\)', '\((\d+)\)\*(\d+)', '(\d+)\*\...

Converting strings to operators

S = '(2*3)+Z*14*(3*5)+(7)*(9)-(11)*13' while true newS = regexprep(S, {'\((\d+)\)\*\((\d+)\)', '\((\d+)\)\*(\d+)', '(\d+)\*\...

1 jour ago | 0

| accepted