Answered
Plotting a straight line y=c
The easiest way to plot a horizontal line at *|‘c1’|* is simply: plot(xlim, c1*[1 1]); The *|xlim|* call returns the cu...

8 years ago | 3

| accepted

Answered
Creating discretized grid without values, only text
Try this: x = 0:0.1:1; y = 0.25; figure plot([x; x], [ones(1, numel(x))*0.5; zeros(1, numel(x))], 'k') tex...

8 years ago | 2

| accepted

Answered
How do I create a random matrix from a normal distribution given the mean and variance (mean = 2 and variance = 8).
I would just do this: mu = 2; vr = 8; RandomNormalMatrix = mu + sqrt(vr)*randn(100); See the documentation on the...

8 years ago | 4

| accepted

Answered
How to separate string and number?
This is a rather trivial <https://www.mathworks.com/help/matlab/ref/regexp.html *|regexp|*> (link) call: str = 'abcdef[123...

8 years ago | 0

Answered
Strange output using symbols in a matrix
Use the <https://www.mathworks.com/help/symbolic/vpa.html *|vpa|*> (link) function. Result = vpa(dh_t(0,pi/2,L1,t2), 3) ...

8 years ago | 0

Answered
Need help with band pass filter!
Although designed in the frequency domain, digital filters created by *|bandpass|* and most other functions operate in the time ...

8 years ago | 0

| accepted

Answered
plot3 - How to show the grid on only the XY-plane?
I am not certain about what you want. Search the documentation page on <https://www.mathworks.com/help/matlab/ref/matlab.graphi...

8 years ago | 0

| accepted

Answered
Replacement for for loops
Try this: [U,V] = meshgrid(-1:1); Am = exp((-1i*(U-V).^2)/2); A = Am(:).'; It produces the same output as your co...

8 years ago | 0

| accepted

Answered
Converting Symbolic State Space to Transfer Function
Your *|‘A’|* matrix and *|‘B’|* vector contain symbolic variable *|‘v’|*: A = [ 0, 0, ...

8 years ago | 0

Answered
Parameter Estimation for Differential Equation according to data measured
I will now delete your Comment from the other post. I found the problem, and your code now works. Your *|‘kinetics’|* func...

8 years ago | 0

| accepted

Answered
how to end a loop at second last iteration?
I would do: d = [0; d];

8 years ago | 2

Answered
error in fopen when use dlmread
Simply use the one line: file1 = dlmread('Matched_TNG20100518CISI_N.txt','', 5, 0); Then, check to see what *|‘file1’|*...

8 years ago | 0

Answered
Tesla K20 GPU not working under Windows 10 Enterprise
You may also have to update MATLAB. To do this, in the main MATLAB toolbar at the top, click on *Add-Ons*, then click on the la...

8 years ago | 0

Answered
How do I find out what has changed in a specific version of Matlab/Simulink?
See the documentation section on <https://www.mathworks.com/help/relnotes/index.html *Release Notes*> (link). For specific Simu...

8 years ago | 1

| accepted

Answered
Annotations with arrows for scatter plot
*_‘... with data labels of the same length as my x and y data vectors.’_ That could be the problem. The documentation does...

8 years ago | 0

| accepted

Answered
can you help me to change this plot to nano meter scale ! i want x multiply by 10^-6
If you simply want to label the *|x|*-axis, without changing anything else, try this: t = linspace(0, 2*pi); s = sin(t)...

8 years ago | 0

| accepted

Answered
why am i getting the error: Index in p
You _may_ be calling *|‘myeuler’|* incorrectly. You must pass your *|‘f’|* argument as a function handle: [t, y] = myeule...

8 years ago | 0

Answered
Error in nonlinear regression
You are not extracting your *|table|* variables correctly. This works (extracting the data from your *|table|*): X = ...

8 years ago | 0

| accepted

Answered
Setting up parasite model
One way you can check to be certain that no two positions are the same is to be certain that the positions are unique: foo...

8 years ago | 0

Answered
Why am i receiving "Array indices must be positive integers or logical values." error?
The problem: t = linspace (0, 10, 937); x(t) = exp(-ez.*wn.*t) .* (x0.*cos(wd.*t) + ((v0+(ez.*wn.*x0))./wd)... ...

8 years ago | 1

| accepted

Answered
Error on REPMAT PROBLEM
The arguments designating the dimensions to be replicated must be integers. It is not possible to replicate a fraction of a dim...

8 years ago | 0

Answered
sir shows an error in line2
Your code works correctly (with a different image) when I run it. Note that the *|superpixels|* function was introduced in ...

8 years ago | 0

| accepted

Answered
Why this error with `axis`
*_‘... limits and style, both are legitimate properties’_* They are. However you have to call them separately: figure...

8 years ago | 0

Answered
How do determine the pressure? Please check me my code.
To do numerical integration, you need to use the *|integral|* function. Here, it is also necessary to use *|arrayfun|* to inte...

8 years ago | 1

| accepted

Answered
How to change my unit to SI?
The problem is that you do not want to use the *|'s'|* option if you want a numeric input. (The *|'s'|* specifies a *|char|* in...

8 years ago | 0

| accepted

Answered
Need help inputing words
You need to add the *|'s'|* to the *|input|* argument list, and then use *|strcmp|* for the comparison. Try this: ...

8 years ago | 0

| accepted

Answered
third order differential equation with matlab
If you are using the Symbolic Math Toolbox, solving it is something of a challenge. This is a linear differential equation: ...

8 years ago | 0

Answered
Solve for two equation with two unknown variables
Use <https://www.mathworks.com/help/symbolic/vpasolve.html *|vpasolve|*> (link), specifically: [X,Y]=vpasolve(Eq1,Eq2,x,y)...

8 years ago | 1

| accepted

Answered
I'm multiplying 2 3x3 matrices and the answer is displaying as a 1x9, how can i fix this?
Your code is printing what you told it to print. Try this: A=[0.4 0.1 0.2;0.3 0.7 0.7;0.3 0.2 0.1]; b=[0.4 0.1 0.2...

8 years ago | 0

| accepted

Answered
how to find two values with a single function
Function calls only return the first output by default. If you waant both, you need to ask for it. Try this: [v, t] ...

8 years ago | 0

| accepted

Load more