Answered

the histgram of G is showing a straght line in this code

DeltaR=(rand(1000,1)-0.5)*2 R1=R10*(1+DeltaR*dR) So R1 is a constant times (1+DeltaR*dR) R2=R20*(1+DeltaR*dR); so R2 is a co...

the histgram of G is showing a straght line in this code

DeltaR=(rand(1000,1)-0.5)*2 R1=R10*(1+DeltaR*dR) So R1 is a constant times (1+DeltaR*dR) R2=R20*(1+DeltaR*dR); so R2 is a co...

ongeveer 6 uur ago | 1

Answered

How to preserve 2-d initial conditions after passing it into ode45?

When I step through the code in ode45, x is a 7200 x 1, 1-d array. How do I ensure x remains a 2-d matrix? To do that, write yo...

How to preserve 2-d initial conditions after passing it into ode45?

When I step through the code in ode45, x is a 7200 x 1, 1-d array. How do I ensure x remains a 2-d matrix? To do that, write yo...

ongeveer 6 uur ago | 1

| accepted

Answered

How can i use the output of function after parfor loop?

parfor ii =1:10 for jj = 1:length(DynamicAnalysis.Name) chk=1; GroupName=char(GlobalGroupDescrption(ii));...

How can i use the output of function after parfor loop?

parfor ii =1:10 for jj = 1:length(DynamicAnalysis.Name) chk=1; GroupName=char(GlobalGroupDescrption(ii));...

ongeveer 7 uur ago | 0

Answered

Renaming function so that its shorter?

https://www.mathworks.com/help/matlab/math/parameterizing-functions.html

Renaming function so that its shorter?

https://www.mathworks.com/help/matlab/math/parameterizing-functions.html

ongeveer 14 uur ago | 0

| accepted

Answered

Help with resolving out of memory

You should be preallocating the cell array Vehicle and VID as cell(nBEV,nBev} The size of the cells are 108x108, In Vehicle, ev...

Help with resolving out of memory

You should be preallocating the cell array Vehicle and VID as cell(nBEV,nBev} The size of the cells are 108x108, In Vehicle, ev...

ongeveer 15 uur ago | 0

| accepted

Answered

How to give the variable name of a large dataset to a table

Once you have created the table T (let it default to whatever variable names it wants for the moment), then T.Properties.Variab...

How to give the variable name of a large dataset to a table

Once you have created the table T (let it default to whatever variable names it wants for the moment), then T.Properties.Variab...

ongeveer 15 uur ago | 0

Answered

Legend doesn't show correct colors

Your code assumes that shadedErrorBar creates exactly one graphics object per call. However if you are using https://www.mathwor...

Legend doesn't show correct colors

Your code assumes that shadedErrorBar creates exactly one graphics object per call. However if you are using https://www.mathwor...

ongeveer 15 uur ago | 0

| accepted

Answered

Dimensions do not match.

thetavals = -1:0.01:1; A = [0.96058 0.82596 0.576 0.29171 0.12276 0.12276 0.29171 0.576 0.82596 0.96058]; u = sin(thetavals)...

Dimensions do not match.

thetavals = -1:0.01:1; A = [0.96058 0.82596 0.576 0.29171 0.12276 0.12276 0.29171 0.576 0.82596 0.96058]; u = sin(thetavals)...

ongeveer 15 uur ago | 0

Answered

How to change values for variables that are defined in a equation

syms a b c d syms x eqn = (a - b + 6.96*x + (6-(31*c)/1000)*x/60*1000 + 31*c/1000*d/60*1000)*0.0081 - 0.1824 -x == 0; sol = s...

How to change values for variables that are defined in a equation

syms a b c d syms x eqn = (a - b + 6.96*x + (6-(31*c)/1000)*x/60*1000 + 31*c/1000*d/60*1000)*0.0081 - 0.1824 -x == 0; sol = s...

ongeveer 16 uur ago | 0

| accepted

Answered

Sharing C mex variables Between Client and parallel Workers

mexMakeMemoryPersistent is the equivalent of persistent and is not the equivalent of global . If you need changes in one worker...

Sharing C mex variables Between Client and parallel Workers

mexMakeMemoryPersistent is the equivalent of persistent and is not the equivalent of global . If you need changes in one worker...

ongeveer 16 uur ago | 0

Answered

Read table in .txt to MATLAB

%Read data file: Drag and Lift Coeff. saveFlCdCl = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/586711/Save_...

Read table in .txt to MATLAB

%Read data file: Drag and Lift Coeff. saveFlCdCl = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/586711/Save_...

ongeveer 16 uur ago | 0

| accepted

Answered

1000 separator and decimal separator are both commas

str2double(regexprep(s, {',(?=.*,)', ','}, {'', '.'}))

1000 separator and decimal separator are both commas

str2double(regexprep(s, {',(?=.*,)', ','}, {'', '.'}))

ongeveer 18 uur ago | 0

| accepted

Answered

extract one of the bits in fi(), flip it, and reassemble it to produce new bin

input = '1010'; input(3) = 'a' - input(3) ... It's magic ;-) flipped = (1 - (x - '0')) + '0' flipped = 1 + '0' + '0' - x fl...

extract one of the bits in fi(), flip it, and reassemble it to produce new bin

input = '1010'; input(3) = 'a' - input(3) ... It's magic ;-) flipped = (1 - (x - '0')) + '0' flipped = 1 + '0' + '0' - x fl...

ongeveer 18 uur ago | 0

Answered

Split arrays and Apply function

event1 = [7.046, 15.66, 24.16] B = [0.53, 1.25, 2.01, 2.78, 3.51, 4.25, 4.96, 5.78, 6.55, 7.26, 7.98, 8.76, 9.54, 10.32,11.08, ...

Split arrays and Apply function

event1 = [7.046, 15.66, 24.16] B = [0.53, 1.25, 2.01, 2.78, 3.51, 4.25, 4.96, 5.78, 6.55, 7.26, 7.98, 8.76, 9.54, 10.32,11.08, ...

ongeveer 18 uur ago | 0

Answered

I am unable to solve my system of equations using MATLAB, Can anyone go through the code and suggest me some?

syms x1 x2 y1 y2 z1 z2 syms d d1 d2 intersxn_angle theta1 theta2 syms x y z eqn1 = (x-x1)*(x-x2)+ (y-y1)*(y-y2)+(z-z1)*(z-z...

I am unable to solve my system of equations using MATLAB, Can anyone go through the code and suggest me some?

syms x1 x2 y1 y2 z1 z2 syms d d1 d2 intersxn_angle theta1 theta2 syms x y z eqn1 = (x-x1)*(x-x2)+ (y-y1)*(y-y2)+(z-z1)*(z-z...

ongeveer 19 uur ago | 1

| accepted

Answered

How to plot a sphere using plot tool

You can construct a list of coordinates, X, Y, Z, and use plot3(X, Y, Z, '*') to cause the points to be plotted in 3 space, w...

How to plot a sphere using plot tool

You can construct a list of coordinates, X, Y, Z, and use plot3(X, Y, Z, '*') to cause the points to be plotted in 3 space, w...

ongeveer 19 uur ago | 0

Answered

If, ||, && statements

if Matrix(1,:)=='0'||Matrix(2,:)=='0'||Matrix(3,:)=='0'||Matrix(:,1)=='0'||Matrix(:,2)=='0'||Matrix(:,3)=='0'||(Matrix(1,3)=='0'...

If, ||, && statements

if Matrix(1,:)=='0'||Matrix(2,:)=='0'||Matrix(3,:)=='0'||Matrix(:,1)=='0'||Matrix(:,2)=='0'||Matrix(:,3)=='0'||(Matrix(1,3)=='0'...

ongeveer 19 uur ago | 0

| accepted

Answered

matlab unable to classify variable in parfor loop

b_t(i,i) = phi_t(2); The parfor loop control variable can only occur in one index location. Store the contents into a vecto...

matlab unable to classify variable in parfor loop

b_t(i,i) = phi_t(2); The parfor loop control variable can only occur in one index location. Store the contents into a vecto...

1 dag ago | 0

Answered

Tic Tac Toe game

if A&&B==0 does not mean if A is 0 and B is 0, it means if A is true if B==0 do body end end MA...

Tic Tac Toe game

if A&&B==0 does not mean if A is 0 and B is 0, it means if A is true if B==0 do body end end MA...

1 dag ago | 0

| accepted

Answered

defining the mean of a values inside a matrix

A = randi(9, [1 6]) [A(1), A(1:end-1) + diff(A)/2, A(end)]

defining the mean of a values inside a matrix

A = randi(9, [1 6]) [A(1), A(1:end-1) + diff(A)/2, A(end)]

1 dag ago | 3

| accepted

Answered

for loop label/arguement

That looks suspiciously like an Octave message rather than a MATLAB message... x(j+1)=mu*x(j)(1-x(j)); ^^ MATLAB...

for loop label/arguement

That looks suspiciously like an Octave message rather than a MATLAB message... x(j+1)=mu*x(j)(1-x(j)); ^^ MATLAB...

1 dag ago | 1

Answered

Keep getting the following error : Unable to convert expression containing symbolic variables into double array.

Recheck your assignments and your indexing. b = [0 -2 -1 -1]'; A = [1 0 -1 3; 0 2 1 0; -1 1 6 -1; 3 0 -1 10]; syms alpha rea...

Keep getting the following error : Unable to convert expression containing symbolic variables into double array.

Recheck your assignments and your indexing. b = [0 -2 -1 -1]'; A = [1 0 -1 3; 0 2 1 0; -1 1 6 -1; 3 0 -1 10]; syms alpha rea...

1 dag ago | 0

Answered

While running this program I got the error "Error using mesh (line 71) Data dimensions must agree"

f=1000; s=300; theta= 45; dp=0.000005; rb=35; Rt=20; Rmj=18; Rmn=9; v1=0.4999; v2=0.05; E1=50; E2=137000; t=0:0.1:30...

While running this program I got the error "Error using mesh (line 71) Data dimensions must agree"

f=1000; s=300; theta= 45; dp=0.000005; rb=35; Rt=20; Rmj=18; Rmn=9; v1=0.4999; v2=0.05; E1=50; E2=137000; t=0:0.1:30...

1 dag ago | 0

Answered

How can I write this for Matlab?

if ismember(phrase(i), '79') result = result + 5; elseif ismember(phrase(i), ['SZ' '2':'6' '8']) result = result + 4; ...

How can I write this for Matlab?

if ismember(phrase(i), '79') result = result + 5; elseif ismember(phrase(i), ['SZ' '2':'6' '8']) result = result + 4; ...

1 dag ago | 0

Answered

speed up a for loop

Inside your inner for loop, you read three .nc files. For efficiency, you need to reduce the number of files you need. So revers...

speed up a for loop

Inside your inner for loop, you read three .nc files. For efficiency, you need to reduce the number of files you need. So revers...

1 dag ago | 0

| accepted

Answered

How to check entries in a Matrix diagonal by diagonal

[nrow, ncol] = size(A); count_around = @(A,R,C) sum(A(max(1,R-1:R+1):min(nrow,R-1:R+1), max(1,C-1:C+1):min(ncol,C-1:C+1))) - ...

How to check entries in a Matrix diagonal by diagonal

[nrow, ncol] = size(A); count_around = @(A,R,C) sum(A(max(1,R-1:R+1):min(nrow,R-1:R+1), max(1,C-1:C+1):min(ncol,C-1:C+1))) - ...

1 dag ago | 0

Answered

How Do I Perform Decoding Morse Code Using GUI?

Hint: strsplit() the morse, and ismember into the list of codes to figure out which is being matched. morse={'.----','..---','...

How Do I Perform Decoding Morse Code Using GUI?

Hint: strsplit() the morse, and ismember into the list of codes to figure out which is being matched. morse={'.----','..---','...

2 dagen ago | 0

| accepted

Answered

How to convert from plot3 to surf?

format short g; format compact; fontSize = 18; counter= 0; counter1=0; for ky=0:1:1000 for i=0:1:89 ...

How to convert from plot3 to surf?

format short g; format compact; fontSize = 18; counter= 0; counter1=0; for ky=0:1:1000 for i=0:1:89 ...

2 dagen ago | 1

Answered

Accelerometer data to obtain tremor frequency

triax = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/587501/anj%20off%20rt.txt'); Fs = 333; ns...

Accelerometer data to obtain tremor frequency

triax = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/587501/anj%20off%20rt.txt'); Fs = 333; ns...

2 dagen ago | 0

Answered

I need to plot the same graphic of the image, but without any loop.

x = -5*pi:pi/100:5*pi; k = (1:1:100).'; %not 0! y = sum(2.*( ( (-(-1).^k)./ k ) .* sin(x.*k) )); plot(x,y)

I need to plot the same graphic of the image, but without any loop.

x = -5*pi:pi/100:5*pi; k = (1:1:100).'; %not 0! y = sum(2.*( ( (-(-1).^k)./ k ) .* sin(x.*k) )); plot(x,y)

2 dagen ago | 0

| accepted