Réponse apportée
random permutation for a matrix
That should be easy i = randperm(5); should give you the permutated indices, so that B = A(:,i); is the permutatio...

presque 11 ans il y a | 1

| A accepté

Réponse apportée
Replace char with other and count total numbers
What do you exactly mean by "this variable which is depicted above" and where would the \n be? I think tdd4c1 answered to you...

presque 11 ans il y a | 0

Réponse apportée
Can Matlab read the most recent made file in the default folder?
Hi, you could get the excel files with d= dir('*xls'); and then compare the dates. These are in d(j).date You p...

presque 11 ans il y a | 0

Réponse apportée
How to plot the function f(x)=x^3 - 4x^2 +1 for x∈[0,25]
You almost got it. Since x is a vector, you should use elementwise operators. not x^2 (what's the square of a vector?) but x.^2...

presque 11 ans il y a | 1

| A accepté

Réponse apportée
Combination and surface plot
You could try "trisurf". But I agree with John d'Errico that your have too few data. tri=delaunay(cost,consumption); trisu...

presque 11 ans il y a | 0

Réponse apportée
Is it possible to create a function for display variables with their names on figures?
where do you want that printed? Have you considered using the builtin function "title"? ttl = sprintf('N = %d, dt = %1.4f...

presque 11 ans il y a | 0

Question


clean up standard output when running in background
Hi all, I often run matlab in background, by issuing the following command in linux or mac OS (bash) nohup matlab -nodeskt...

presque 11 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
How to Integrate these data ?
You could use "cumptrapz". For that you'll need to provide both x and y. In this respect, what do you mean "you choose the st...

presque 11 ans il y a | 1

| A accepté

Réponse apportée
How to plot a Power Spectrum (log log plot) for an image?
I think that's because f and p are matrices. In that case all of its columns are plotted. The lines you see are plot(f(:,1)...

presque 11 ans il y a | 0

Question


object properties treated as structures
Hi all, I always thought that you should use get and set to play with object properties. From time to time I stumble on a...

presque 11 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
axis changes even after "axis equal"
If I understand this correctly, you want an animation with fixed xlim, but you do not want to set the xdata and ydata (I agree w...

presque 11 ans il y a | 2

Réponse apportée
How can I draw a parity plot?
% scatter plot plot(x,y,'.'); hold % bisector (basically the same as Thorsten) plot([0.5 3],[0.5 3]); % upper and low...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Replace char with other and count total numbers
I do not see the relevance of strings or newline chars. What is the object you're showing? What is the result of whos x ...

presque 11 ans il y a | 1

Réponse apportée
from random number segregation of values?
I think that this should work :) x=rand; y = 2+1.0*(x>0.31)+3.0*(x>=0.6);

presque 11 ans il y a | 0

Réponse apportée
How to plot point coordinates with connecting lines in between.
that's not matlab syntax. Reading the documentation of "plot" is a good idea here. Type doc plot (enter) Anyway, you should b...

presque 11 ans il y a | 0

Réponse apportée
Plot and animate a 3D Dice Image
perhaps placing dots (circles) instead of numbers on the faces of the dice is easier, at least for a traditional cubic dice. Tha...

presque 11 ans il y a | 0

Réponse apportée
How do you get a number string to display the sign (pos and/or neg) in front of it.
Perhaps use sprintf? For instance, if a, b, c are integers ttl = sprintf('f(x) = %+d x^2 %+d x %+d',a,b,c); title(ttl); ...

presque 11 ans il y a | 0

Réponse apportée
ZERO crossing with certain conditions
I'd go like Y = X-4; c = Y(1:(end-1)).*Y(2:end); Now c(i) should be negative whenever X(i) and X(i+1) are "on different...

presque 11 ans il y a | 0

Réponse apportée
how to properly transfer plotted figure to a MS Word file?
Have you tried tweaking the export setup? Other things you might want to try are changing the marker size or the PaperSize at...

presque 11 ans il y a | 0

Réponse apportée
How to convert a 1D solution to 2D using spherical axis symmetry
This is not very clear. What do you mean by "the _solution_ of a 1D problem of the nature y=f(x)"? It seems to me you're plot...

presque 11 ans il y a | 0

Réponse apportée
Subscript indices must either be real positive integers or logicals.
I guess the line giving grief is x(t) = (F0/m)*(1/wn^2-w^2)*(sin(t.*w)-sin(t.*wn)); x is a vector and t is the subscript ...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
I need help preallocating array?
Look at the function "zeros". array = zeros(1,5); newArray = zeros(1,5*p); and, in the loop newArray((1+(i-1)*5):(i...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
How to flip or mirror some vector parts
From the shape of your curve, I guess that you might get roughly the shape you need by setting yd = (y+fliplr(y))/2 wher...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Create image axis with the origin in the centre
For the double y axis, see this <http://www.mathworks.com/matlabcentral/answers/98353-how-can-i-show-both-top-and-bottom-or-left...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
Create an Exponential Function using Taylor Series
Ok John, you want to use a loop instead of using the matrix capabilities of matlab. Imho your code contains both coding [C] a...

presque 11 ans il y a | 0

Réponse apportée
Using errorbar in MATLAB with asymmetric errorbars
My guess is that momeerr95 contains both the upper and the lower values for the errorbars. Or else, how would matlab know that ...

presque 11 ans il y a | 0

Réponse apportée
Place one image on a blank image but several times i.e (passport style)
Hi, you can try the command axes('position',p), where p is a vector specifying the position in the figure. You can create a...

presque 11 ans il y a | 0

Réponse apportée
How to sum multiple matrices?
Product of matrices is "*". Therefore, if they're the same size, D= A*B*C; If instead you want elementwise product, D = A.*B.*C...

presque 11 ans il y a | 0

| A accepté

Réponse apportée
How to sum multiple matrices?
Hi have you tried the following? D = A+B+C; I'm not sure what you mean with the square parentheses. In matlab square...

presque 11 ans il y a | 0

Réponse apportée
Problems in accessing 2nd column of matrix
Hi, Your code is very obscure. What exactly do you want do attain? In particular, this line temp = xx(xx(k):xx(k+1)); ...

presque 11 ans il y a | 0

Charger plus