Réponse apportée
How do I set the limits on the secondary y axis?
Use <https://www.mathworks.com/help/matlab/ref/ylim.html ylim> right after |yyaxis right|.

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
Extract matrices out of a symbolic matrix
It looks like you are trying to extract the diagonal, upper triangular and lower triangular parts of the matrix. These commands ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Results showing up as NaN
Here is one source of NaN's: In |slipratio_fun| with the initial value of |t=0| and |v=0|, you have |omega=v=0|. The line ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Warning: The solutions are parameterized by the symbols: z
The function |solve| is part of the Symbolic Math Toolbox. Are you defining the symbolic variables? If I run this code syms...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to calculate value using different matrix using if and for loop
In the line if abs(b) < 14.5 the condition is looking at the entire 100 x 1 vector |b|, and the condition is only true i...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can we plot a function with domain involving infinity
Of course, you can't plot the whole thing, but you can plot enough so that it's obvious where the curve is going. One approach i...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How can I change a certain part of a graph to a certain constant value?
Here is one way: y(x>=0.2*pi & x<=0.8*pi) = sin(0.2*pi); Note that I use inequalities because there are no values of |x|...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Convert complex double to double type
Judging by the discussion in the <http://stackoverflow.com/questions/37320761/convert-complex-double-to-double-type-in-matlab St...

plus de 7 ans il y a | 0

Réponse apportée
what does this line means in the following code? I=I(200:400,250:450,:); and when i change the ratio there comes an error of "index exceeds matrix dimensions"
The function <https://www.mathworks.com/help/matlab/ref/imread.html imread> retrieves a 3D array consisting of 2D images in vari...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How to plot a single collection of points
You need to separate the x and y coordinates. Here is one solution: data = [X{:}]; xdata = data(1,:); ydata = data(2,:) p...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
findpeaks() neglecting the high amplitude peaks.Does not work as exptected
When I try this code, I get 7 plots, and figure 7 looks like your figure except that all the peaks are correctly identified: ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Double Integral using Integral2 Error
Based on the above discussion, the critical part of code you need is as follows: myfun_eq8=@(phi) exp(f*phi).*cos(phi).*sin...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Extract every subexpression in a symbolic expression between + and -
Depends whether you have muPAD. In the Symbolic Toolbox, you can use E = expand(E); to separate the terms, but then you ...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
How do I call and multiply handles from an array in integral or quad function?
You can replace B by a cell array of functions, and then call the functions when it's time to integrate: Bfuns = {@(x) ones...

plus de 7 ans il y a | 1

| A accepté

Réponse apportée
Storing a struct in a cell
Try curly brackets: groupavg{:,i} = averages.timelock.(subject{i}); This places the RHS _inside_ the cell element instea...

plus de 7 ans il y a | 2

| A accepté

Réponse apportée
In an assignment A(:) = B, the number of elements in A and B must be the same.
Look at the first part of a line of code in |projectmatrix.m|: dx(2) = ((k1 - k2)/m1)*u1 On the left side, you have a sc...

plus de 7 ans il y a | 0

| A accepté

Réponse apportée
Simplify symbolic expression for optimized code generation
I don't know how particular you are about the exact form of the simplified expression, but this certainly produces a simpler exp...

plus de 7 ans il y a | 0

Réponse apportée
How to calculate euclidean distance for 3 vectors using matlab
You can find the Euclidean distance between two vectors |v1| and |v2| using <http://www.mathworks.com/help/matlab/ref/norm.html ...

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
What answers should be "Answer of the week"?
Here is <http://www.mathworks.com/matlabcentral/profile/authors/869215-john-d-errico John D'Errico> again, answering the questio...

plus de 9 ans il y a | 0

Réponse apportée
one thing i need to know
For your specific problem, some useful pages are <http://www.mathworks.com/company/newsletters/articles/matrix-indexing-in-matla...

plus de 9 ans il y a | 1

Réponse apportée
smooth a surface plot
You can make a mesh: [P1,P2] = meshgrid(P1,P2); Then use |interp2|. *EDIT:* Corrected typo.

plus de 9 ans il y a | 1

Réponse apportée
how to count the total number of recursion ?
The problem is that you're not passing |num| to |collatz|, so how can it know how many times it has been called? Here is a versi...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
Add values to a Matrix
If you're trying to collect all the values for the inner loop ( |for i=1:fil| ), you could try putting M = []; above the...

plus de 9 ans il y a | 0

Réponse apportée
Plotting 10 graphs with different colors and markers
There is a table in <http://www.mathworks.com/help/matlab/ref/linespec.html LineSpec (Line Specification)> with 13 different mar...

plus de 9 ans il y a | 0

Réponse apportée
Unnest a Matrix of strings
If I understand what you're trying to do, you can't do it. A 3x3 matrix of strings looks like this: ['abc';'def';'ghi'] ...

plus de 9 ans il y a | 1

Réponse apportée
Simple question about plotting a convolution
Your code will give you a vector of length |length(y1)+length(y2)-1|, so you'll get an error if you plot it against |x| (which i...

plus de 9 ans il y a | 0

Réponse apportée
Inner matrix dimensions must agree.
Note the top error statement: Inner matrix dimensions must agree. Have you tried testing these functions with vector arg...

plus de 9 ans il y a | 0

Réponse apportée
Help on sign function argument
Use 2*sign(x-0.01)-1

plus de 9 ans il y a | 0

| A accepté

Réponse apportée
How to Create Libraries in Matlab?
The simplest approach would be to put the functions in their own folder and add that folder to the <http://www.mathworks.com/hel...

plus de 9 ans il y a | 1

| A accepté

Réponse apportée
Make Smooth Curves using the points
The reason your points are not connected is that you are plotting them one at a time. You need to create some vectors and plot t...

plus de 9 ans il y a | 0

Charger plus