Answered
Leapfrog integration with multiple particles
This works (with a much smaller value for *|‘steps’|*): time=100; steps=1000000; % steps = 100; dt=time/(...

8 years ago | 0

| accepted

Answered
how to specify the X and Y ticklable?
Replace your current *|set|* calls: set(gca,'XTickLabel',{vec}) set(gca,'YTickLabel',{vec}) with these assignments: ...

8 years ago | 1

| accepted

Answered
Derivative is calculated 2 different ways.
They are two versions of the same expression: syms x f(x) = ((x^2)+4)^2*(2*x^3-1)^3; df = diff(f) df = simplify(d...

8 years ago | 0

| accepted

Answered
Adding sentences with calculated numbers to a plot
Use the <https://www.mathworks.com/help/matlab/ref/text.html *|text|*> (link) function. *_Example_ —* x = 1:10; y ...

8 years ago | 1

Answered
How to average 5 rows of a matrix iteratively?
This creates ‘blocks’ of *|5|* rows each, then takes the mean down the columns (across rows) of each ‘block’. I shortened the m...

8 years ago | 0

Answered
How to plot a linear function in using for loop in matlab
You need to add *|‘no_of_points’|* as an argument to your *|‘findCoodinates’|* function. You also need to subscript *|‘y’|* in ...

8 years ago | 0

| accepted

Answered
How to turn x,y,counts data into a surface map
Plot your data using the <https://www.mathworks.com/help/matlab/ref/stem3.html *|stem3|*> (link) function. You can easily see i...

8 years ago | 0

| accepted

Answered
How do I duplicate a certain column of a matrix?
Try this: nodes = [1 2;3 4;5 6]; new_matrix = reshape(repmat(nodes, size(nodes,2), 1), size(nodes,1), []) new_ma...

8 years ago | 0

Answered
Converting symbolic variables to numeric
Your *|‘S’|* solution is a function of *|‘x’|*. If you want to create an anonymous function that you can use in numeric computa...

8 years ago | 1

Answered
Obtaining the minimum value of solutions
The ‘minimum’ depends on how you want to define it. Most of the results returned in *|‘sol’|* are _complex_, and the *|min|* fu...

8 years ago | 1

| accepted

Answered
I cant find GA Optimization in 2018 Matlab
The <https://www.mathworks.com/help/gads/ga.html *|ga|*> (link) function is part of the *Global Optimization Toolbox*. I do...

8 years ago | 0

| accepted

Answered
How to calculate area under each peak from my plot?
See if this does what you want: D = load('data for plot.txt'); x = 0:numel(D)-1; ...

8 years ago | 0

| accepted

Answered
Solving an equation to get a particular solution
Use *|vpasolve|* to get all the results, then in the second *|fprintf|* call, simply choose the values of *|‘sol’|* greater than...

8 years ago | 0

| accepted

Answered
how to store Fibonacci iteration results?
In your *|‘k’|* loop, add a line saving the appropriate value of *|‘x1’|* or *|‘x2’|* (or both, as I do here) along with the ite...

8 years ago | 1

| accepted

Answered
How to estimate parameter values from the nonlinear function
*_‘Could you tell me how to fix this problem in more details?’_* One way is to scale *|‘Energy’|* or *|‘Emission’|* or both...

8 years ago | 0

Answered
during the execution of matlab programe, a variable is producing output 200.1236 i want to display 200.1236012457
x = 200.1236012457; format long g disp(x) 200.1236012457 Documentation reference: <https://www.m...

8 years ago | 0

| accepted

Answered
I was trying to solve below simultaneous differential equation and I had the warning "Unable to find explicit solution" Can someone explain?
Not all ordinary differential equations have analytical solutions, and most non-linear differential equations do not. Try t...

8 years ago | 0

Answered
how to create different plots in the same figure and create different yaxis for all the plots
Try something like this: x = linspace(-2, 2, 50); y = [10*exp(-2*(x.^2))+10; 10*exp(-4*(x.^2))+20; 10*exp(-8*(x.^2))+30...

8 years ago | 0

Answered
Find the layer the minimum number occurs
Try this: M = rand(4, 5, 3) % Create Matrix [Mmin,Idx] = min(M,[],3) % Ret...

8 years ago | 0

| accepted

Answered
First time user. I have created a plot and now need to changte the color of the lines. How would I go about this?
In *|R2014b|* and later, you can easily change the line colors and styles using the ‘structure’ references to the plot: x1...

8 years ago | 1

Answered
Plotting of an inline function
See: <https://www.mathworks.com/matlabcentral/answers/416278-how-do-you-user-input-a-equation-in-matlab-i-used-inline-function-b...

8 years ago | 0

Answered
How to scale the x axis ?
I am not certain what you want to do. If you want to actually synchronize the signals, consider using the <https://www.math...

8 years ago | 1

Answered
matrices A*x =B where x> 0
Try this using *|lsqlin|*: A = [ 0.770335115000000 0.229664885000000 0 0 0; 0.689230654000000 0.287340926000000 0.02342842...

8 years ago | 1

Answered
How can I compute t-stat for MLE parameters?
I have no idea what a Garch regression is, since my knowledge of econometrics is essentially nonexistent. For a simple line...

8 years ago | 0

| accepted

Answered
Can anyone answer why don't the grid on the surface is not coming in this 3D plot ?
Your *|‘zz’|* matrix is *|(2001x2001)|*. You cannot see the individual grid lines because they are too close together on your p...

8 years ago | 0

| accepted

Answered
joining integer ans decimal part of number
The easiest way is to just add them: n1 = 100 n2 = 0.025 N = n1+n2 To print them: sprintf('%.3f', n1+n2) ...

8 years ago | 0

Answered
Adding variance as error bars on line plot
There are probably several ways to do the plot, using the <https://www.mathworks.com/help/matlab/ref/errorbar.html *|errorbar|*>...

8 years ago | 2

| accepted

Answered
Issue with ezplot and fplot?
I get the same result for all three plots, except for a slightly different *|y|*-axis scale with *|ezplot|*. syms x fi...

8 years ago | 1

| accepted

Answered
I can't get the correct figure font name
Use the <https://www.mathworks.com/help/matlab/ref/listfonts.html *|listfonts|*> (link) function to find the fonts available on ...

8 years ago | 0

| accepted

Load more