Answered
How do I keep the x-axis the same?
One way: set(gca, 'XLim',[0 1.8]) Put that *|set|* call *_after_* the *|plot|* call.

9 years ago | 0

Answered
Labels don't appear in 3d plot?
The order you list the assignments and function calls in your code is important. Try this: %original figure figure...

9 years ago | 1

| accepted

Answered
how do i plot these 3 graphs on the same plot?
I would use *|subplot|*: % displacement equation y0=A0*exp(-z0*wn*t)*cos(wd0*t-phi0); y1=A1*exp(-z1*wn.*t)*cos(w...

9 years ago | 0

Answered
How do you turn off theta and radius labels in a polar plot?
See the documentation on <https://www.mathworks.com/help/matlab/ref/matlab.graphics.axis.polaraxes-properties.html *PolarAxes Pr...

9 years ago | 0

| accepted

Answered
Help to find the equation of a decreasing exponential function
Two possibilities: x=[20 150 350 1850 3000 7000 13500 21600 28800 63500 70000 140000 250000 338000 445000 589000]; y=[4...

9 years ago | 0

Answered
Synchronise two time series
The *|R2016a|* <https://www.mathworks.com/help/matlab/ref/synchronize.html *|synchronize|*> (link) or the *|timeseries|* version...

9 years ago | 1

| accepted

Answered
i want to compute a cdf for t distribution
You are not calling *|cdf|* correctly. Also the functions are vectorised, so you do not need the loops. Try this: fa...

9 years ago | 0

| accepted

Answered
How can I vectorize a function?
Vectorising it simply requires using element-wise operations: f = @(X,Y) -0.0001*(abs(sin(X).*sin(Y).*exp(abs(100-sqrt(X.^...

9 years ago | 1

| accepted

Answered
Problem with dlmread reading data
Your file is not appropriate for *|dlmread|*. Use <https://www.mathworks.com/help/matlab/ref/textscan.html *|textscan|*> (link)...

9 years ago | 0

| accepted

Answered
How can i plot this function?
Use colons *|(:)|* instead of commas to create *|‘t’|*: t = 0 : 0.1 : 50; y = 0.25*(t) .* sin(2*t); figure plot(t...

9 years ago | 0

| accepted

Answered
Writing function based on a vector of roots
This will calculate the *|x|*-coordinate of the intersection, and plot a green pentagram there: intx = interp1(zbar2, psig...

9 years ago | 1

| accepted

Answered
How do i create a plot like this ?
See the documentation on the <https://www.mathworks.com/help/signal/ref/spectrogram.html *|spectrogram|*> (link) and <https://w...

9 years ago | 0

Answered
how do you write this equation correctly in matlab...matlab is not recognizing the variables
You need to define the operators. I _assume_ you intend multiplication, however MATLAB does not recognise implicit multiplicati...

9 years ago | 0

Answered
How to create a polar rectangle in Matlab
I am not certain what you want. Try this: theta = linspace(0, 2*pi, 5); figure(1) polarplot(theta, ones(siz...

9 years ago | 1

| accepted

Answered
How to use ezplot ?
For a function of two variables, use the *|ezsurf|* (or preferably *|fsurf|*) function instead: syms x1 x2 f(x1, x2) = ...

9 years ago | 0

| accepted

Answered
Draw Triangle using quiver3 command in Matlab
Try this: a=[2 3 4]; b=[6 2 -5]; c=[8 1 -4]; abc = [a; b; c; a]; dabc = diff([abc; a]); figure(1) ...

9 years ago | 1

| accepted

Answered
Plotting multiple contour plots in one graph
See if the <https://www.mathworks.com/help/matlab/ref/contour3.html *|contour3|*> (link) function will do what you want.

9 years ago | 0

| accepted

Answered
When I plot this, the line isn't showing up on the graph
You need to save *|‘tauMax’|* a vector. Since *|‘T’|* does not have contiguous entries (the step increment is *|5|*), it is bes...

9 years ago | 0

| accepted

Answered
Help on error while trying to solve differential equation
Use a numeric solver, such as *|ode45|*. This works: %Declare variables C_1 = 1.27575*10^-10; C_2 = 0.991667; ...

9 years ago | 0

Answered
How can ı get transfer function.
This is an interesting problem, and eminently solvable with the System Identification Toolbox. First, the Fourier transform...

9 years ago | 2

| accepted

Answered
How can I plot a 3D graph for Z=5*X*Y*(1-X-Y)?
Try this: [X,Y] = meshgrid(linspace(0, 10, 25)); Z = 5*X.*Y.*(1-X-Y); figure(1) surf(X, Y, Z) grid on v...

9 years ago | 0

| accepted

Answered
How to analyze movement data
The <https://www.mathworks.com/help/matlab/ref/retime.html *|retime|*> (link) function, specifically the method described in <ht...

9 years ago | 0

| accepted

Answered
Finding Statistics of a Matrix Help!!!
Force the array into a vector, then use *|mean|*, *|std|*, the appropriate version of *|iqr|*, and the rest. *_Example_ —* ...

9 years ago | 0

| accepted

Answered
find local maxima without using findpeaks()
If you have *|R2017b|*, use the <https://www.mathworks.com/help/matlab/ref/islocalmax.html *|islocalmax|*> (link) function. ...

9 years ago | 4

Answered
Fix Error: Operands to the || and && operators must be convertible to logical scalar values.
I ma not certain what you want to do. Try this: x = zeros(1,101); x(1) = pi/4; for k = 1:100 x(:,k+1) = ...

9 years ago | 0

| accepted

Answered
How to use optimizer with ode45?
If you are fitting your differential equations to data, see <http://www.mathworks.com/matlabcentral/answers/43439-monod-kinetics...

9 years ago | 0

Answered
Locating origin of points and translating to new origin.
I am not certain what you are asking. Try this: x = -5:10; y = randn(size(x)); figure(1) plot(x, y) A...

9 years ago | 0

| accepted

Answered
Set up tolerance and maximal iteration number for lsqlin
The *|lsqlin|* function is designed solve *_constrained_* linear problems. You have specified no constraints, so it would be mo...

9 years ago | 0

| accepted

Answered
How do I find these values from a plot?
I have no idea what your parameter abbreviations mean, since they are not completely standardized. There are a number of Co...

9 years ago | 0

| accepted

Answered
How to get the ticks for each value of the logarithmic scale?
The ticks between *|10^0|* (or *|1|*) and *|10^1|* (or *|10|*) are the integers between *|1|* and *|10|*. They are scaled logar...

9 years ago | 0

| accepted

Load more