Answered

Some problems with “writematrix” function。

%if true T = ["100011";"101000"]; iwant = str2double(T); writematrix(iwant,'your file.txt')

Some problems with “writematrix” function。

%if true T = ["100011";"101000"]; iwant = str2double(T); writematrix(iwant,'your file.txt')

4 hours ago | 0

Answered

How to add values around a vector without changing the vector values.

%if true Y = 1:21; Y = Y' Y(1,1) = 0; Y(21,1) = 0

How to add values around a vector without changing the vector values.

%if true Y = 1:21; Y = Y' Y(1,1) = 0; Y(21,1) = 0

13 hours ago | 0

Answered

Directivity function (polar pattern) of acoustic dipole in closed form?

%if true theta = 0:360 polar(sin(theta).^2*pi/180)% sin^2(theta)

Directivity function (polar pattern) of acoustic dipole in closed form?

%if true theta = 0:360 polar(sin(theta).^2*pi/180)% sin^2(theta)

21 hours ago | 1

| accepted

Answered

P(t)=25sin(35t) euler method

%if true x = zeros(1,2); There is no _xeros_ function im matlab

P(t)=25sin(35t) euler method

%if true x = zeros(1,2); There is no _xeros_ function im matlab

22 hours ago | 0

Answered

How do I get a loop to calculate for each value of a formula, not just the last n of the input(N)?

%if true for j=1:N You need to use above loop structure. You don't need one for loop

How do I get a loop to calculate for each value of a formula, not just the last n of the input(N)?

%if true for j=1:N You need to use above loop structure. You don't need one for loop

22 hours ago | 0

Answered

Import data doesn't import some of the values

T = readtable('weighted_network.txt') % you can also use readmatrix function

Import data doesn't import some of the values

T = readtable('weighted_network.txt') % you can also use readmatrix function

1 day ago | 0

Answered

Create a histogram of y-axis positions at x=100?

hold on Y = 1:30; X = 1:100; bar(X(end),Y*0.1,'stacked'); % scaled to represent bar with plot You can use the above at the ...

Create a histogram of y-axis positions at x=100?

hold on Y = 1:30; X = 1:100; bar(X(end),Y*0.1,'stacked'); % scaled to represent bar with plot You can use the above at the ...

1 day ago | 0

Answered

how to change x and y values to a range of values

X=linspace(-2*c,1*c,20); % define X vector similar to Y but of same number of divisions i.e. 20 Y=linspace(-.7*c,0.1*c,20); %...

how to change x and y values to a range of values

X=linspace(-2*c,1*c,20); % define X vector similar to Y but of same number of divisions i.e. 20 Y=linspace(-.7*c,0.1*c,20); %...

1 day ago | 0

Answered

How to plot level curves

[X,Y] = meshgrid(700:1:900,-100:1:100); % assumed in nano and micro meters Z = exp(-0.5.*((X-800)./40).^2)*cos((2*pi.*Y*1000...

How to plot level curves

[X,Y] = meshgrid(700:1:900,-100:1:100); % assumed in nano and micro meters Z = exp(-0.5.*((X-800)./40).^2)*cos((2*pi.*Y*1000...

1 day ago | 0

Answered

Error plot is starting at the wrong value in my "while loop"

while t1<6 theta1(i+1)=theta1(i)+psy1(i)*dt1 psy1(i+1)=(-g/l)*dt1*theta1(i)+(1-c*dt1)*psy1(i); theta_exact(i)=1...

Error plot is starting at the wrong value in my "while loop"

while t1<6 theta1(i+1)=theta1(i)+psy1(i)*dt1 psy1(i+1)=(-g/l)*dt1*theta1(i)+(1-c*dt1)*psy1(i); theta_exact(i)=1...

1 day ago | 0

Answered

Function keeps getting errors, how to fix?

function RH = RelHum(Tdb, Twb) syms n % define the symbolic n ftoc = @(n) ((n-32)*(5/9)); svp = exp(1)^((16.78*ftoc(Tdb) ...

Function keeps getting errors, how to fix?

function RH = RelHum(Tdb, Twb) syms n % define the symbolic n ftoc = @(n) ((n-32)*(5/9)); svp = exp(1)^((16.78*ftoc(Tdb) ...

1 day ago | 1

| accepted

Answered

How do I fix this error to output the correct data? I get an error when I use disp.

disp(['You caught ', wholeFishWeight , ' kg of fish for Whole Fish, to be sold for $' , wholeFishIncome]) disp(['You caught ' ,...

How do I fix this error to output the correct data? I get an error when I use disp.

disp(['You caught ', wholeFishWeight , ' kg of fish for Whole Fish, to be sold for $' , wholeFishIncome]) disp(['You caught ' ,...

1 day ago | 0

Answered

Create two x axes, but one of them is a log scale

Read semilogx function https://in.mathworks.com/help/matlab/ref/semilogx.html

Create two x axes, but one of them is a log scale

Read semilogx function https://in.mathworks.com/help/matlab/ref/semilogx.html

1 day ago | 0

Answered

I have complex output values, but the output displays the 0 of the other half as well

M= [ 0+9i 0+1i ; 0+1i 67+19i] disp(table(imag(M),'VariableNames',{'Impedence Matrix'})) %Imp = table(real...

I have complex output values, but the output displays the 0 of the other half as well

M= [ 0+9i 0+1i ; 0+1i 67+19i] disp(table(imag(M),'VariableNames',{'Impedence Matrix'})) %Imp = table(real...

2 days ago | 0

Answered

Composite Simpson's 1/3 rule code error

syms x % define x as symbol %x = linspace(0, 4,5); fx=@(x) 1-exp(-x); % use function handle as D'Errico suggested Then you ...

Composite Simpson's 1/3 rule code error

syms x % define x as symbol %x = linspace(0, 4,5); fx=@(x) 1-exp(-x); % use function handle as D'Errico suggested Then you ...

2 days ago | 0

Answered

Changing variables within loop equations

L = 1:21; % use a vector for iteration /counter for i = 1:1:L(8) % access them via L ... % your code end for i = L(9):1:...

Changing variables within loop equations

L = 1:21; % use a vector for iteration /counter for i = 1:1:L(8) % access them via L ... % your code end for i = L(9):1:...

3 days ago | 0

| accepted

Answered

How to extract specific values in some pattern from rows and columns of a table?...(in this case somewhat zig zag)

see this solution shown in below link https://in.mathworks.com/matlabcentral/answers/373937-how-to-find-pattern-in-an-array

How to extract specific values in some pattern from rows and columns of a table?...(in this case somewhat zig zag)

see this solution shown in below link https://in.mathworks.com/matlabcentral/answers/373937-how-to-find-pattern-in-an-array

3 days ago | 0

Answered

how can i make this animation faster in MATLAB?

hmax = 25; % max height n = 100; % make this value smaller h = linspace(0,hmax,n); t = linspace(0,360,n); k = 0; pt = 1/600...

how can i make this animation faster in MATLAB?

hmax = 25; % max height n = 100; % make this value smaller h = linspace(0,hmax,n); t = linspace(0,360,n); k = 0; pt = 1/600...

3 days ago | 0

Answered

index exceeds matrix dimensions

j=0; for j=1:dt:40 for i=2:n-1 M(i,j)=1-(1-a)*alpha*(1-exp((-alpha/(i1*Yw)*(U(i+1,j)-U(i-1,j))/(2*dz)))); end end

index exceeds matrix dimensions

j=0; for j=1:dt:40 for i=2:n-1 M(i,j)=1-(1-a)*alpha*(1-exp((-alpha/(i1*Yw)*(U(i+1,j)-U(i-1,j))/(2*dz)))); end end

3 days ago | 0

Answered

Plot time on x axis for 24 hours duration

%if true T = hours(0:2:24) TT = duration(T,'Format','hh:mm') Rd = rand(13,1) plot(TT,Rd) xticks(TT); xticklabels({'00:00',...

Plot time on x axis for 24 hours duration

%if true T = hours(0:2:24) TT = duration(T,'Format','hh:mm') Rd = rand(13,1) plot(TT,Rd) xticks(TT); xticklabels({'00:00',...

3 days ago | 0

Answered

Transfer function, function, Fcn, G

%f true num = [1.077e4] den = [3.439e-7 1 0] Enter the vectors _num and den_ coefficients in the transfer function blo...

Transfer function, function, Fcn, G

%f true num = [1.077e4] den = [3.439e-7 1 0] Enter the vectors _num and den_ coefficients in the transfer function blo...

3 days ago | 0

| accepted

Answered

Plotting e^-t graph

t = 0:0.1:10; y = exp(-t); plot(t,y) define t and use exp function to calculate and plot the equation

Plotting e^-t graph

t = 0:0.1:10; y = exp(-t); plot(t,y) define t and use exp function to calculate and plot the equation

3 days ago | 1

Answered

How to plot multiple unit tangent vector along a 3D curve using quiver3

t = linspace(0, 2, 80); x1 = t; y1 = t.^2; z1 = t.^3; TangentUni = 1./sqrt(1+4*t.^2+9*t.^4), 2*t./sqrt(1+4*t.^2+9*t.^4), 3*t...

How to plot multiple unit tangent vector along a 3D curve using quiver3

t = linspace(0, 2, 80); x1 = t; y1 = t.^2; z1 = t.^3; TangentUni = 1./sqrt(1+4*t.^2+9*t.^4), 2*t./sqrt(1+4*t.^2+9*t.^4), 3*t...

3 days ago | 0

| accepted

Answered

How to use fprintf to show collated values for two arrays.

for i = 1:length(X); fprintf('%d,%d\n',X(i),Y(i)); end

How to use fprintf to show collated values for two arrays.

for i = 1:length(X); fprintf('%d,%d\n',X(i),Y(i)); end

3 days ago | 1

| accepted

Answered

Error on Switch/case with cell array char data

get = input('type(letters only, no puncuation): ' , 's'); split = char(get); sorted_split = sort(split); input_prob = []; fo...

Error on Switch/case with cell array char data

get = input('type(letters only, no puncuation): ' , 's'); split = char(get); sorted_split = sort(split); input_prob = []; fo...

3 days ago | 0

Answered

Incorrect Impulse Train Waveform Fourier Representation

%if true %% Definition %% N = 90000; % number of harmonics t = -10:2:10; T_0 = 4; % time period w0 = 2 * pi * (1/T_0)...

Incorrect Impulse Train Waveform Fourier Representation

%if true %% Definition %% N = 90000; % number of harmonics t = -10:2:10; T_0 = 4; % time period w0 = 2 * pi * (1/T_0)...

4 days ago | 0

Answered

How to increase maximum number of iterations in a 'for' loop, when in the loop?

Delete the *break* statement inside the *if* condition and run again.

How to increase maximum number of iterations in a 'for' loop, when in the loop?

Delete the *break* statement inside the *if* condition and run again.

4 days ago | 0

Answered

having legend title and enlarging legend marker size at the same time

%f true %lgd.MarkerSize = 20 set(lgd,'MarkerSize',20); lgd.Title.String = 'Recoating Velocity (%)'; lgd.Title.FontSize = ...

having legend title and enlarging legend marker size at the same time

%f true %lgd.MarkerSize = 20 set(lgd,'MarkerSize',20); lgd.Title.String = 'Recoating Velocity (%)'; lgd.Title.FontSize = ...

4 days ago | 0

Answered

Generate signal using rectpulse

%if true sign1 = rectpuls(t,A) plot(t,sign1) Use the *rectpuls* function to plot

Generate signal using rectpulse

%if true sign1 = rectpuls(t,A) plot(t,sign1) Use the *rectpuls* function to plot

4 days ago | 0

| accepted

Answered

why do I have unrecognized function error for z?

%if true buff = char(buff);% convert to char or number switch buff case 'none' z = 0; case '...

why do I have unrecognized function error for z?

%if true buff = char(buff);% convert to char or number switch buff case 'none' z = 0; case '...

4 days ago | 0