Answered
How can I simulate a resource allocation?
According to what you have stated in your exercise description and understood, this code can be written: D = load('detected.mat...

27 dagar ago | 0

Answered
accuracy test higher than training
You can try to employ random selection of the data for training and validation using randperm() or randsample(), for example. A...

27 dagar ago | 0

Answered
FOR LOOP ERROR IN MATLAB
[for end] loop is working perfectly ok, but there is an error in your defined function's input arguments. See the corrections: ...

27 dagar ago | 0

Answered
Trying to solve equations within ranges
One of the viable solutions is to use symbolic math: syms and solve. clearvars; clc x1=-2; x2=2; y1=-2.1; y2=2.1; x = x1:0.1...

27 dagar ago | 0

| accepted

Answered
adding column ( cell) to matrix
x = (1:5).'; % Vector F1 = categorical({'A'; 'B'; 'C'; 'D'; 'E'}); % Cell Categorical Array F2 = ...

27 dagar ago | 0

Answered
How do I estimation of the means of a random variable?
% lower and upper bounds of the Uniform random variable X: a= 0; b = 2; % True values of the mean and variance of X: m = (b-...

27 dagar ago | 0

| accepted

Answered
How to retrieve the index of positions starting with a specific character in a cell array?
x1 = 5000; x2 = 3000; x3 = 1000; x4 = 800; x5 = 500; array1 = ([x1,x2,x3,x4,x5]).'; array2 = categorical({'A1';'A2';'B1'...

27 dagar ago | 0

Answered
adding column ( cell) to matrix
WHat you are trying to do is to augment all variables into one array, correct? In this case, table array might be a good one, e....

27 dagar ago | 0

Answered
How do I estimation of the means of a random variable?
In order to generate a normally distributed random numbers, you can employ clc; clearvars; close all Npop = 7.5e2; ...

27 dagar ago | 0

Answered
Solve second order non linear differential equation
You can try a builtin fcn: bvp4c(). Here is a nice documentation on bvp4c() with examples: https://www.mathworks.com/help/matlab...

27 dagar ago | 0

| accepted

Answered
How do I put annotation text pointing towards specific coordinate?
Here you can use the values of c to place where you want your annotation to be displayed along with the arrow. E.g.: ... c={A...

27 dagar ago | 0

Answered
adding column ( cell) to matrix
x = 1:25; % Vector F = {x} % Cell Array H = x + F{:}

28 dagar ago | 0

Answered
change the origin of a graph
x = 1:13; y = 2*x+3; plot(x, y, 'r*--'), grid on set(gca, 'YDir','reverse'), xlabel('x'), ylabel('y')

28 dagar ago | 0

| accepted

Answered
How can I create a stacked bar graph with the following chart?
A = {'Fastball_{Ball}'; 'Curveball_{Strike}'; 'Fastball_{Strike}'; 'Curveball_{Ball}'}; A = categorical(A); C = [10;15;20;25]...

28 dagar ago | 0

| accepted

Answered
I want to change y interval from 100 to 200 (0, 200, 400...) & mark in x axis (0,1,2,3...) please guide
E=[0:1:10]; E=[1:1:9]; Q=[65 160 300 420 550 678 763 840 882]; plot(E,Q,'-r*') axis([0,10,0,1000]) grid on xticklabels({'0...

28 dagar ago | 0

Answered
Symbolic Solver dot indexing error and general understanding
Because your equations don't have solutions, i.e.: ... solve(eqn1(1,1), eqn(1,2)) % Check

28 dagar ago | 0

Answered
problems with integration tolerances when using ode15s
The answer lies in magnitudes of the calculated (integration) values of the variables that don't allow to have the set tolerance...

28 dagar ago | 0

| accepted

Answered
I want to change y interval from 100 to 200 (0, 200, 400...) & mark in x axis (0,1,2,3...) please guide
Use xticks(), yticks(), xticklabels(), yticklabels(), e.g.: S =@(t) 10*t.^2+2*t+10; fplot(S, [0, 10], 'r-*'), grid on; xticks(...

28 dagar ago | 0

Answered
How do i normalize a signal so that it's maximum is 1?
t=linspace(0, 2, 1e3); f1 = 5; f2 = 10; S = cos(2*pi*f1*t)+sin(2*pi*f2*t)+rand(size(t))/5; subplot(211) plot(t,S), title('O...

28 dagar ago | 0

Answered
How to duplicate rows of a matrix if the number of copies for each row are different?
It can be done in a few different ways, e.g.: A = magic(3) b = [2, 4, 5]; AA = [repmat(A(1,:), b(1),1);repmat(A(2,:), b(2),1)...

28 dagar ago | 0

Answered
Equations to Matrix Solve
This exercises can be solved realtively easy using some symbolic toolbox fcns such as coeffs(). See this doc: https://www.mathw...

28 dagar ago | 0

Answered
How to convert this function of one variable into MATLAB code?
You have done a good job, but there are a couple of small (imperative) points to consider - to take out real and imaginary parts...

29 dagar ago | 0

Answered
How to plot transcendental equation?
clc clearvars close all nf= 1.3; ns=1.5; nc=1; rho=1; hf=2; lambda = 100:350; m=1; syms neff phi_c = - atand((nf/nc...

ungefär en månad ago | 0

Answered
How to update during ODE45
This can be computed with a [for .. end] loop, e.g.: clc; clearvars w = ...; Trq = 10*w; % E.g. w_0 = -1.5; % E.g. J = 1...

ungefär en månad ago | 0

Answered
How to solve a differential equation system with time and space derivates? Where to write (i, j) (i-1, j) (i, j-1)?
First, that would be nice for simulation speed to suppress to display the results. To do that you'd need to put semicolon at the...

ungefär en månad ago | 1

Answered
feature selection for regression
Test and study these posts and codes posted on MATHWORKS: https://www.mathworks.com/discovery/feature-selection.html?s_tid=answ...

ungefär en månad ago | 0

| accepted

Answered
modifying the legend for multiple plots
You should introduce a new cell variable with legend names as you specified, e.g.: TimeInterval = [{'0:00am- 3:00am'}, {'3:00am...

ungefär en månad ago | 0

| accepted

Answered
I have 5 nonlinear algebraic equations with many terms, fsolve command is ineffective in solving these nonlinear equations.
It is worth to employ here optim options of fsolve(), e.g.: optimoptions() with fmincon, lsqnonlin, fminunc. See the help doc: ...

ungefär en månad ago | 0

Answered
How to speed up processing and reduce memory with nested for loops
For most of calcs in your code can be done directly without [for .. end] loops, e.g.: A= 0:Ind_FilterConstraint; B=A; C=B; %...

ungefär en månad ago | 0

Answered
Printing a variable in a fprintf
This can be done in a relatively simple way. VTL="5kV"; fprintf('Initial Value is: %s circuit values\n', VTL) ... % Your cal...

ungefär en månad ago | 0

Load more