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

4 years 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...

4 years ago | 0

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

4 years 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')

4 years 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]...

4 years 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...

4 years 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

4 years 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...

4 years 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(...

4 years 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...

4 years 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)...

4 years 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...

4 years 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...

4 years 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...

4 years 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...

4 years 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...

4 years 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...

4 years 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...

4 years 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: ...

4 years 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; %...

4 years 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...

4 years ago | 0

Answered
How to create a equally distributed batting order for little league baseball team
Here is how it can be generated for 10 times within a loop: for ii=1:10 A(ii,:) =randperm(10, 10); end

4 years ago | 0

Answered
How to make a contour plot with incomplete z data?
As I understood your question correctly, you'd need to employ something like this one to get controurf(Z) from the values of X a...

4 years ago | 0

Answered
How to create a equally distributed batting order for little league baseball team
Use randperm() to generate the orders, e.g.: ORDER = randperm(10,10)

4 years ago | 0

Answered
What do I have to fix the plot to make it work?
It is working ok now, but your formulations have some problems. Thus, the calculated results (xI, SI, PI) are not OK. clc; clea...

4 years ago | 1

Answered
solving system of non linear equations using fsolve by converting symbolic expressions
Here is the solution: syms c d e x; R=(1+(1-c-d-e+c*x^2+d*x^3+e*x^4))*(2*c+6*d*x+12*e*x^2) + (2*c*x+3*d*x^2+4*e*x^3)^2 -(1-c-d...

4 years ago | 0

| accepted

Answered
loop do add easy part
Cris already gave a very good answer to your question, BUT if you want to get it via loop only as an exercise. Here is how it ca...

4 years ago | 0

Answered
Issues with Horzcat for defining a variable as a row vector
You had better use this vectorized approach instead of a loop based calculation of norm values, i.e. norme, normr, normutilde: ...

4 years ago | 0

| accepted

Answered
Import data from CSV file by Import Tool or textscan
Use readmatrix() that would import all numerical data in a matrix form.

4 years ago | 0

Answered
How can I give each values of torque for value of RPM as an input?
Yes, indeed this can be done in Simulink and matlab. For Simulink modelling, you can employ the following block for input data: ...

4 years ago | 0

Load more