Respondida
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...

alrededor de 3 años hace | 0

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

alrededor de 3 años hace | 0

Respondida
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...

alrededor de 3 años hace | 1

Respondida
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...

alrededor de 3 años hace | 0

Respondida
(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',...

alrededor de 3 años hace | 0

| aceptada

Respondida
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) =...

alrededor de 3 años hace | 1

Respondida
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 ...

alrededor de 3 años hace | 1

| aceptada

Respondida
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 ...

alrededor de 3 años hace | 0

Respondida
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)

alrededor de 3 años hace | 0

Respondida
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 ...

alrededor de 3 años hace | 0

Respondida
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...

alrededor de 3 años hace | 1

Respondida
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...

alrededor de 3 años hace | 0

| aceptada

Respondida
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...

alrededor de 3 años hace | 0

Respondida
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];

alrededor de 3 años hace | 0

Respondida
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(...

alrededor de 3 años hace | 0

| aceptada

Respondida
invalid use of operator for matlab loop?
% rename the variable as T or something other, TT = readtable('Final_COVID_Data (2).xls')

alrededor de 3 años hace | 1

Respondida
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}'}));

alrededor de 3 años hace | 1

| aceptada

Respondida
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,...

alrededor de 3 años hace | 0

Respondida
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...

alrededor de 3 años hace | 0

Respondida
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 ...

alrededor de 3 años hace | 0

Respondida
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 ...

alrededor de 3 años hace | 0

| aceptada

Respondida
Problem with using siunitx (latex) in xlabel, ylabel,
add another preceding \ as below xlabel('Zeit $(SI[\\s]$)', 'Interpreter', 'latex');

alrededor de 3 años hace | 0

Respondida
For Loop That Uses A Found Value To Complete the Next Loop
Do you mean something like this ? z2 = 10; Z1 = 4; P2 = zeros(1,length(P1)); for J = 1:Array_range_max % P1 computed in...

alrededor de 3 años hace | 0

| aceptada

Respondida
Wien oscilator in Matlab and Simulink, problems
Since you know it's due to nature of Dirac delta function, it would make sense if you modify this line as below jedst=sub...

alrededor de 3 años hace | 0

Respondida
What's the reason for this not being able to plot a graph for the group size and probabilities?
plot function uses vectors to plot lines, in your case groupsize is scalar but probability is vector clc,clear group_size = 1...

alrededor de 3 años hace | 1

| aceptada

Respondida
Can I put words in branching statements?
Yes, you can use conditional if-else statements like this preferably inside a function function V = myFunction(V,V_air,air) ...

alrededor de 3 años hace | 0

Respondida
write code to solve trigonometric equation
p= @(x) (cosh(x).*cos(x)+1); x=[-2*pi:0.1:2*pi]; plot(x,p(x));

alrededor de 3 años hace | 0

| aceptada

Respondida
How can I define initial condition in a for loop?
v_0= [9; 9]; T=10; dt=0.0001; % define the time step in the time vector K = 1:dt:T v1=zeros(length(K)+1,3); v=zeros(lengt...

alrededor de 3 años hace | 0

Respondida
Faster processing time for code
did you try changing step size ? clear clc tic %%CONSTANTS%% c = 2.998e8; %ms-1, speed of light e = 1.602e-19; %C, elect...

alrededor de 3 años hace | 0

Respondida
Display output from neural network on APP Designer
%Loading the trained neural network mdl = load('MSB.mat') % Predicting the output from the input ...

alrededor de 3 años hace | 0

Cargar más