Answered

A line does not appear when I plot

% inside the for loop Temp(h) = q./(6*k_w)*(r_I.^2) + T_sI % outside the for loop Temp(Temp == 0 ) = []; plot(1000:10000,T...

A line does not appear when I plot

% inside the for loop Temp(h) = q./(6*k_w)*(r_I.^2) + T_sI % outside the for loop Temp(Temp == 0 ) = []; plot(1000:10000,T...

17 days ago | 1

| accepted

Answered

Running a function multiple times and recording outputs for each of the runs in one table.

Assuming some random data, the output data can be fit into a table as shown below % some random data data= randi([2 200],12...

Running a function multiple times and recording outputs for each of the runs in one table.

Assuming some random data, the output data can be fit into a table as shown below % some random data data= randi([2 200],12...

18 days ago | 0

Answered

sinc + cos function plot

Delete pi from below line % delete pi from the below line a = (-4:0.001:4); p = 10; f = p*sinc(a) + cos(a) plot(a,f)

sinc + cos function plot

Delete pi from below line % delete pi from the below line a = (-4:0.001:4); p = 10; f = p*sinc(a) + cos(a) plot(a,f)

19 days ago | 0

| accepted

Answered

Adding fields of two different structs together

part(1) = struct('name', 'x', 'number', 1) part(2) = struct('name', 'y', 'number', 2); part(3) = struct('name', 'z', 'number'...

Adding fields of two different structs together

part(1) = struct('name', 'x', 'number', 1) part(2) = struct('name', 'y', 'number', 2); part(3) = struct('name', 'z', 'number'...

19 days ago | 0

Answered

Integration with Symbolic Variables

syms theta r a=10; x=a*(1-cos(theta)); y=a*(1-sin(theta)); r=sqrt(x^2+y^2) I = vpaintegral(r,0,2*pi)

Integration with Symbolic Variables

syms theta r a=10; x=a*(1-cos(theta)); y=a*(1-sin(theta)); r=sqrt(x^2+y^2) I = vpaintegral(r,0,2*pi)

19 days ago | 0

| accepted

Answered

Only seven lines of code, the program runs continuously without any results when solving the equation

syms I A B = 0.02;%blocking probability N = 8;%number of channels very huge FN = factorial(N); ACell = solve((A^N)/FN == B*s...

Only seven lines of code, the program runs continuously without any results when solving the equation

syms I A B = 0.02;%blocking probability N = 8;%number of channels very huge FN = factorial(N); ACell = solve((A^N)/FN == B*s...

19 days ago | 0

Answered

Not your typical vertcat error. Weird behaviour with it.

load("nlworkspace.mat") m1 = parameters(1) m2 = parameters(2) k1 = parameters(3) k2 = parameters(4) d1 = parameters(5) d2 ...

Not your typical vertcat error. Weird behaviour with it.

load("nlworkspace.mat") m1 = parameters(1) m2 = parameters(2) k1 = parameters(3) k2 = parameters(4) d1 = parameters(5) d2 ...

21 days ago | 0

| accepted

Answered

Change selected item in ListBox

Assign value as output argument to function ParadigmaAuswahlListBoxValue as shown below, and pass it as input argument to functi...

Change selected item in ListBox

Assign value as output argument to function ParadigmaAuswahlListBoxValue as shown below, and pass it as input argument to functi...

21 days ago | 1

Answered

Latex en la leyenda de los graficos

you can use the $\hat{u}$ in legend function , The latex interpreter fonts usually appear smaller compared to regular fontsiz...

Latex en la leyenda de los graficos

you can use the $\hat{u}$ in legend function , The latex interpreter fonts usually appear smaller compared to regular fontsiz...

21 days ago | 0

Answered

How to plot like the following scatter plot on MATLAB?

data = [11,10;10,11;9,10;20,18;10,11;11,10;10,9]; figure; plot(data);grid figure; hold on sz = 100; scatter(1:size(data,1)...

How to plot like the following scatter plot on MATLAB?

data = [11,10;10,11;9,10;20,18;10,11;11,10;10,9]; figure; plot(data);grid figure; hold on sz = 100; scatter(1:size(data,1)...

21 days ago | 0

Answered

Error using plot - not enough input arguments / invalid data argument

the variables which are trying to plot are cell array of strings from a table. The plot function call takes NUMERIC (DOUBLE) arr...

Error using plot - not enough input arguments / invalid data argument

the variables which are trying to plot are cell array of strings from a table. The plot function call takes NUMERIC (DOUBLE) arr...

21 days ago | 0

Answered

Want Cells in Struct to Show Up as a String

T.data = table(["Apple";"Banana"]) T.data = table2array(table(["Apple";"Banana"])) You can use *table2array* function as a...

Want Cells in Struct to Show Up as a String

T.data = table(["Apple";"Banana"]) T.data = table2array(table(["Apple";"Banana"])) You can use *table2array* function as a...

23 days ago | 0

Answered

(i) x-and-y scales defined as "log", or (ii) calculate the log of variables, or (iii) loglog

% Method 1 figure plot(1:10, 1:10) ax = gca; % put this after plot call and use as below set(ax,'XScale', 'log', 'YScale',...

(i) x-and-y scales defined as "log", or (ii) calculate the log of variables, or (iii) loglog

% Method 1 figure plot(1:10, 1:10) ax = gca; % put this after plot call and use as below set(ax,'XScale', 'log', 'YScale',...

23 days ago | 0

| accepted

Answered

I want to rounding selected data with Looping and If else

a = rand(1)*randi([5 25],510,1) n=length(a); for i=1:n if(a(i) > 0 & a(i) < 10) a(i) = a(i); else a(i) =...

I want to rounding selected data with Looping and If else

a = rand(1)*randi([5 25],510,1) n=length(a); for i=1:n if(a(i) > 0 & a(i) < 10) a(i) = a(i); else a(i) =...

23 days ago | 1

Answered

Finite Differencing Transient Conduction

May be the central and forward difference schemes are not correct, but the following change will avoid the code errors clc ...

Finite Differencing Transient Conduction

May be the central and forward difference schemes are not correct, but the following change will avoid the code errors clc ...

25 days ago | 1

| accepted

Answered

How to add zeros diagonally in a matrix?

close all; clear all; clc; A= [0 0 0 1 0 -1 0 -1 -1 0 1 -1 0 0 1 -1 ...

How to add zeros diagonally in a matrix?

close all; clear all; clc; A= [0 0 0 1 0 -1 0 -1 -1 0 1 -1 0 0 1 -1 ...

25 days ago | 0

Answered

Don't sort variables(syms) in equation

syms U_L U_Q U_R U_C eqn = "U_L+U_Q+U_C==U_R" displayFormula(eqn)

Don't sort variables(syms) in equation

syms U_L U_Q U_R U_C eqn = "U_L+U_Q+U_C==U_R" displayFormula(eqn)

26 days ago | 0

Answered

Greetings. I recently started using MATLAB. Could you pleas explain me why plot(x1, y , 'm-') is not working?At the same time figure is displayed with the second plot.

% when the input to function is vector of value y = function_y(1:10) function y = function_y(x) var_1 = x.*(1 - log(x)); y ...

Greetings. I recently started using MATLAB. Could you pleas explain me why plot(x1, y , 'm-') is not working?At the same time figure is displayed with the second plot.

% when the input to function is vector of value y = function_y(1:10) function y = function_y(x) var_1 = x.*(1 - log(x)); y ...

26 days ago | 0

Answered

Array indices must be positive integers

assign the func to f inside the custom function as below , probably you mean this f = @(x) x.^3.*exp(-x.^3); a = 0; b = 10; n...

Array indices must be positive integers

assign the func to f inside the custom function as below , probably you mean this f = @(x) x.^3.*exp(-x.^3); a = 0; b = 10; n...

26 days ago | 1

Answered

I wish to limit plotting a point on a single line and not anywhere else on the graph (just on the line) with every input

for M1 = 1:1:5 m = m+1; %================================ % theta-beta-M relat...

I wish to limit plotting a point on a single line and not anywhere else on the graph (just on the line) with every input

for M1 = 1:1:5 m = m+1; %================================ % theta-beta-M relat...

27 days ago | 0

Answered

Using matlabFunction with symbollic expression containing a matrix

Can you tell why you would like to convert the symbolic matrix to anonymous function? The error you get is due to symbolic matri...

Using matlabFunction with symbollic expression containing a matrix

Can you tell why you would like to convert the symbolic matrix to anonymous function? The error you get is due to symbolic matri...

27 days ago | 0

Answered

Filling matrix with cell arrays in a loop leaves all rows empty except the last one

% place this line outside of all loops matrix = cell(48,1); matrix{i} = [Var1 Var2 Var3];

Filling matrix with cell arrays in a loop leaves all rows empty except the last one

% place this line outside of all loops matrix = cell(48,1); matrix{i} = [Var1 Var2 Var3];

28 days ago | 0

Answered

Can I execute only one case inside multiple cases inside switch ?

Yes, you can execute it single case from each round by adding an extra for loop % define round sequence randCases=randperm(...

Can I execute only one case inside multiple cases inside switch ?

Yes, you can execute it single case from each round by adding an extra for loop % define round sequence randCases=randperm(...

29 days ago | 0

| accepted

Answered

invalid use of operator for matlab loop?

% rename the variable as T or something other, TT = readtable('Final_COVID_Data (2).xls')

invalid use of operator for matlab loop?

% rename the variable as T or something other, TT = readtable('Final_COVID_Data (2).xls')

30 days ago | 1

Answered

Remove numbers from axis and use strings instead

t = 0:0.01:10; a = 1.02; Y = a*t.^2; plot(t,Y); xticks([min(t) max(t)]) xticklabels(string({'t_{start}','t_{end}'}));

Remove numbers from axis and use strings instead

t = 0:0.01:10; a = 1.02; Y = a*t.^2; plot(t,Y); xticks([min(t) max(t)]) xticklabels(string({'t_{start}','t_{end}'}));

30 days ago | 1

| accepted

Answered

How can I write y0 code in one line and still I can get this output.

y0= [ (1e-2)*rand(2,1); ((-3.14).*rand(1,1) + (3.14).*rand(1,1)); (1e-2)*rand(2,1); ((-3.14).*rand(1,1) + (3.14).*rand(1,...

How can I write y0 code in one line and still I can get this output.

y0= [ (1e-2)*rand(2,1); ((-3.14).*rand(1,1) + (3.14).*rand(1,1)); (1e-2)*rand(2,1); ((-3.14).*rand(1,1) + (3.14).*rand(1,...

30 days ago | 0

Answered

Problem with for loop in given algorithm

unless Queue length value is not varying, you can initialize it as below and access in 2D matrix to include previous queue lengt...

Problem with for loop in given algorithm

unless Queue length value is not varying, you can initialize it as below and access in 2D matrix to include previous queue lengt...

30 days ago | 0

Answered

Help! Scatter command question

GeneA = [1.1 0.5 27 1.4 1.9 2.6 3.2 8.1 4.1 0.4 9.4 13 14.1 9.1 18.2 2.1 5.3 16.4 7 21.1 0.3 7.5 17.1 5.2 13.1]; GeneB = [0.2 ...

Help! Scatter command question

GeneA = [1.1 0.5 27 1.4 1.9 2.6 3.2 8.1 4.1 0.4 9.4 13 14.1 9.1 18.2 2.1 5.3 16.4 7 21.1 0.3 7.5 17.1 5.2 13.1]; GeneB = [0.2 ...

30 days ago | 0

Answered

We have taken measurements of the activity of 2 genes for 25 patients. In order to store this data, you must create a 2x25 component matrix.

GeneA = [1.1 0.5 27 1.4 1.9 2.6 3.2 8.1 4.1 0.4 9.4 13 14.1 9.1 18.2 2.1 5.3 16.4 7 21.1 0.3 7.5 17.1 5.2 13.1]; GeneB = [0.2 ...

We have taken measurements of the activity of 2 genes for 25 patients. In order to store this data, you must create a 2x25 component matrix.

GeneA = [1.1 0.5 27 1.4 1.9 2.6 3.2 8.1 4.1 0.4 9.4 13 14.1 9.1 18.2 2.1 5.3 16.4 7 21.1 0.3 7.5 17.1 5.2 13.1]; GeneB = [0.2 ...

30 days ago | 0

| accepted

Answered

Problem with using siunitx (latex) in xlabel, ylabel,

add another preceding \ as below xlabel('Zeit $(SI[\\s]$)', 'Interpreter', 'latex');

Problem with using siunitx (latex) in xlabel, ylabel,

add another preceding \ as below xlabel('Zeit $(SI[\\s]$)', 'Interpreter', 'latex');

1 month ago | 0