Réponse apportée
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];

presque 3 ans il y a | 0

Réponse apportée
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(...

presque 3 ans il y a | 0

| A accepté

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

presque 3 ans il y a | 1

Réponse apportée
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}'}));

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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,...

presque 3 ans il y a | 0

Réponse apportée
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...

presque 3 ans il y a | 0

Réponse apportée
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 ...

presque 3 ans il y a | 0

Réponse apportée
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 ...

presque 3 ans il y a | 0

| A accepté

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

presque 3 ans il y a | 0

Réponse apportée
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...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

Réponse apportée
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...

presque 3 ans il y a | 1

| A accepté

Réponse apportée
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) ...

presque 3 ans il y a | 0

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

presque 3 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 3 ans il y a | 0

Réponse apportée
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...

presque 3 ans il y a | 0

Réponse apportée
Display output from neural network on APP Designer
%Loading the trained neural network mdl = load('MSB.mat') % Predicting the output from the input ...

presque 3 ans il y a | 0

Réponse apportée
Chain array indexing error to access elements of a function
test = @(t) [t, t^2] % test using t = 10 y = test(10); % define e.g function x = @(t) t.^2+2*t % get the value of funct...

presque 3 ans il y a | 0

Réponse apportée
"Index in position 2 exceeds array bounds. Index must not exceed 401" Error. Can someone explain to me why here an error appears?
I guess, L may be a vector or array which keeps changing in your program. Try the below x_exact = randn(size(A,1),length(L)+1);...

presque 3 ans il y a | 1

Réponse apportée
How to create array while using integral function?
K1=6;%(W/m.K)Thermal conductivity of Fe3O4 nanoparticle K2=0.598; %Thermal conductivity of water-https://thermtest.se/thermal-c...

presque 3 ans il y a | 0

Réponse apportée
How use equation to solve for an array of values
Sig_a= [379 345 276 517 483 414 345 345 310 552 483 414 586 552 483]; Sig_m= [621 621 621 414 414 414 414 414 414 207 207 207 ...

presque 3 ans il y a | 0

Réponse apportée
Modify an array elements using a for loop
numberSamples = 4; userSamples = [2 12 9 20]; minValue = 10; for k = 1:numberSamples if userSamples(k) < minValue ...

presque 3 ans il y a | 0

Réponse apportée
Im putting in my equations wrong and i need help
There are several changes needed in your equations, please look at the comments in the code where the changes are necessary T1...

presque 3 ans il y a | 0

Réponse apportée
Calculate complex integral formula
syms x real n = 0; F = log(x+abs(n))./log(x.^2+n.^2); F3 = vpaintegral(F,x,1,2)

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Can you change individual elements in a for loop each time?
clc;clear;close all figure hold on col = {'ro','bd','k+'} col1 = {'r-','b-','k-'} % plots points for x=1:3 y=5; plot(x,...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
display a MATLAB table in a figure
fig = uifigure(); Use *uifigure*

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Adding to existing date value
d = datetime(2023,3,27, 'Format','u-MM-dd') d = datetime(addtodate(datenum(d),5,"day"),'ConvertFrom','datenum','Format','u-MM-d...

presque 3 ans il y a | 0

Réponse apportée
Unable to get the correct 3-D Helix plot using the parameters
% Define the parameters p = 0.199; % Pitch distance a = 0.02999500; % Radius of the helix wire b = 0.191; % Radius of the ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
WHAT would be the reason this matlab code works but does not draw the graphic?
The y0 and v0 values are both zero and that results in infinite value, which cannot be plotted. Give suitable values to both v...

presque 3 ans il y a | 0

Réponse apportée
Error in ode45
As error suggests that inputs must be of type 'double' , there is a symbolic variable declaration for variable t_o inside th...

presque 3 ans il y a | 0

| A accepté

Charger plus