Réponse apportée
Help finding the min and max of a matrix without using min/max commands
Change the two lines max=mat2; min=mat2; to max = -inf; min = inf; Note: It is a poor practice to use ...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Help with iteration!!?
Your while-loop does not seem to be very useful. On the first pass through it sets Wd equal to Wdf and because the "(Wdf-Wd)> 0...

presque 10 ans il y a | 0

Réponse apportée
To reshape the number of elements must not change matlab error
It looks to me as though your original 'bits' array contains a number of elements other than n*m. You can't change the total nu...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
check points inside triangle or on edge with example
Suppose P1 = [x1,y1], P2 = [x2,y2], and P3 = [x3,y3] are row vectors giving the coordinates of the three vertices of a triangle,...

presque 10 ans il y a | 2

| A accepté

Réponse apportée
Calculate Exponentials WITHOUT built-in exponent function?
Trying to compute x^n using only summation is a terrible method. Surely you would be allowed to use multiplication! ExpVa...

presque 10 ans il y a | 1

| A accepté

Réponse apportée
How to increase the speed of this code?
Try 'ndgrid': [X,Y,Z] = ndgrid(0.01:0.01:1); pts = [Z(:),Y(:),X(:)]; %(Corrected)

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Keep getting error: Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to change the limit. Be aware that exceeding your available stack space can crash MATLAB and/or your computer.
Your code is clearly meant to be recursive. However, there is something wrong in the way it is planned. You first call "equili...

presque 10 ans il y a | 0

Réponse apportée
Monte Carlo Experiment in Huffman
In case you don't have access to a huffman compression algorithm, I would expect in your particular case the huffman encoding wo...

presque 10 ans il y a | 0

Réponse apportée
How to get the inverse function when it's only 1-1 in certain range?
As you have defined iphi2 it is simply one of the two solutions to a quadratic equation: z = 1-sqrt(1-phi2)

presque 10 ans il y a | 0

Réponse apportée
I want to make this assignment : Const = log(2)/703 800 000 but i keep getting this error massage, 'Matrix dimensions must agree' and I have no idea what that even means. How do I go about this?
If "730 800 000" is meant to be a three-element row vector you need to write: const = log(2)./[730 800 000]; If "730 80...

presque 10 ans il y a | 0

Réponse apportée
Error using ==> times Matrix dimensions must agree.
Your vector t is a row vector, that is, presumably 1 by 1024 in size. If there is no complaint in plot(t,x), then x must also b...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
How to write function that recognizes whether a year (e.g2010) input by user is leap year or not
I recommend you put matlab's 'mod' function to good use. Here is one way: t = mod(y,4)==0 & (mod(y,100)~=0 | mod(y,400)==...

presque 10 ans il y a | 0

Réponse apportée
How to get rid of the error: Error using horzcat. Dimensions of matrices being concatenated are not consistent.
Both the expressions for A and B are invalid. In A the three quantities zeros(3,3), eye(3,3), zeros(3,1) have a total ...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Solving the following integral in MatLab
If b and c are both nonzero, then as x approaches infinity the factor exp(-c*x/(a-b*x)) approaches exp(c/b) which would be nonze...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
finding four solution in an interval
Use matlab function 'fzero' to find solution to fun = @(x) exp(-2*x).*sin(x+4)-0.4; x = fzero(fun,x0); where x0 is ...

presque 10 ans il y a | 0

Réponse apportée
Help-Integration of Bessel functions
It is likely that an explicit expression for either of those integrals as functions of 'a' is not known in mathematics and there...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
Help-Integration of Bessel functions
Use numerical integration with matlab's 'integral' function or one of the other quadrature functions.

presque 10 ans il y a | 0

Réponse apportée
Trying to use quad to solve this integral but keep getting error
You've forgotten the dot in your division. It should be: y = @(x)((1.941-24.3*x).^2)./(2.92*(0.02408-x)*(0.01605-x));

presque 10 ans il y a | 0

Réponse apportée
fill matrix randomly with a specific number of units
The tough part of your requirement is to not duplicate rows. The following while-loop is intended to accomplish that. v =...

presque 10 ans il y a | 0

| A accepté

Réponse apportée
How to generate a random integer betwwen a and b inclusive.
x = 9*rand(n,1)+1; As to "inclusive" this will never give exactly 1 or exactly 10. However if you intended to have an uni...

presque 10 ans il y a | 0

Réponse apportée
comparing numbers on the same vector
y(1) = true; for k = 2:length(x) y(k) = (max(x(1:k-1))<x(k)); end y = double(y);

presque 10 ans il y a | 0

| A accepté

Réponse apportée
To reflect a contour plot
If your symmetry is in the left-right direction, then do: contour(V(:,end:-1:1),500); However, that leaves the two imag...

environ 10 ans il y a | 0

| A accepté

Réponse apportée
Using ode45 to solve second order differential system
The same single function 'x' cannot in general satisfy two different differential equations, so you need to solve these equation...

environ 10 ans il y a | 0

Réponse apportée
Finding angle between thee points
To find the angle rotating counterclockwise from point P1(x1,y1), pivoting around point P2(x2,y2), and ending at point P3(x3,y3)...

environ 10 ans il y a | 0

Réponse apportée
how to calculate all permutations of ['a' 'b' 'c' ... 'x' 'y' 'z'] just 26 characters, yet combinator.m combinations.m return errors
@John: I think you fail to grasp the enormity of 26 factorial. Suppose one of us could come up with your requested scheme of pr...

environ 10 ans il y a | 3

Réponse apportée
I am trying to obtain a series of vectors made of elements from a larger vector given they exceed a threshold
It's not clear whether you want those Z elements which exceed some fixed value or those which make up a monotone increasing sequ...

environ 10 ans il y a | 0

Réponse apportée
How to plot a 3rd order best fit line through 3 sets of data?
How about x1 = [Cv80(:);Cv50(:);Cv30(:)]; y1 = [Cp80(:);Cp50(:);Cp30(:)]; p = polyfit(x1,y1,3); y = polyval(p,x1);...

environ 10 ans il y a | 0

Réponse apportée
How to solve 5 quadratic equations simultaneously
For that particular set of equations you could take steps to make things easier. Introduce a new unknown 't': t = LIDtot-x...

environ 10 ans il y a | 2

| A accepté

Réponse apportée
When I plot, I only get 5 red dots and a blank graph.
You should make two changes: x = linspace(0, 1, w); (or just linspace(0,1) and get the default hundred points) VR = ...

environ 10 ans il y a | 2

Charger plus