답변 있음
how to bypass my complex values inside objective functions? bounds and constraints not working…
I would suggest that in computing your objective function, you yourself apply the constraint of non-negativity to the expression...

11년 초과 전 | 0

답변 있음
How to find the maximum value of the output values from a FOR loop
You can do it this way: maxA = -inf; for t=99:0.01:100 sim('massspringdamper') ys=interp1(t,x,t); ...

11년 초과 전 | 1

| 수락됨

답변 있음
Using cov to find a covariance matrix
If you consult the documentation of 'cov' at http://www.mathworks.com/help/matlab/ref/cov.html you will see that it say...

11년 초과 전 | 2

| 수락됨

답변 있음
Help in integrating an expression
If 'int' is unable to integrate your function, you may have to resign yourself to using numerical integration for which you woul...

11년 초과 전 | 1

| 수락됨

답변 있음
How to enter this program?
You need to translate each of those conditions into a matlab logical proposition. For example if n is an integer you are invest...

11년 초과 전 | 1

| 수락됨

답변 있음
How to find the roots of a derivative
Rather than tell you what is wrong with your method, I prefer to tell you how I think you should approach the problem. The deri...

11년 초과 전 | 2

답변 있음
Using Fzero for one variable in a nonlinear equation with multiple variables
You want a solution for r as an explicit function of a, b, dh, and de. You cannot accomplish that with 'fzero' or any of the fu...

11년 초과 전 | 2

| 수락됨

답변 있음
Constructing matrix elements conditionally (and sequentially)
C = zeros(size(A)); C(A>0) = B; (Note that this will give an error if your assumption that sum(A)==length(B) is not tr...

11년 초과 전 | 1

| 수락됨

답변 있음
How to integrate using while loop?
Strictly speaking, this is an answer to a question you haven't asked, Andrejus, but I thought you might be interested in the fac...

11년 초과 전 | 1

답변 있음
How to compare the first column of the rows to whole matrix?
C = sum(bsxfun(@eq,A(:,1),A),2)-1; % <-- Counts (not counting column 1)

11년 초과 전 | 2

답변 있음
How to integrate using while loop?
In order to show that your problem need not involve time-consuming iterative methods here is the complete solution in four lines...

11년 초과 전 | 2

답변 있음
How to find co-ordinates of a point in 3D using Matlab functions?
This problem is equivalent to finding the common points of intersection of three spheres. You should realize that if there are ...

11년 초과 전 | 2

답변 있음
fprintf Displays the wrong value
You are assigning y string values, not numerical values, but you are displaying them using 'fprintf' for numerical values (%1.2f...

11년 초과 전 | 1

답변 있음
Pulling data from text file and the results are being shown as NaN
I see places in your code that could produce NaNs. In the section sum1=0; sum2=0; for i=1:imax t=m(k,i)...

11년 초과 전 | 2

| 수락됨

답변 있음
How to integrate using while loop?
Actually, Andrejus, if you make a change of variable from w to x according to: w = x^(-1/4), you will see that your pro...

11년 초과 전 | 2

답변 있음
help me to reduce my function time runing
U = (0:99).'; V = 0:2:198; F = (10*sin(U))*cos(V)+(10*cos(U))*sin(V); imagesc(F); colormap(gray);

11년 초과 전 | 4

| 수락됨

답변 있음
Sigma notation - two variables. 'for' loop or symsum?
Axx = x.'*hankel(x,zeros(1,N/4+1));

11년 초과 전 | 2

답변 있음
[Matlab]Desperate help with a simple code.
M = randi([5,18],1000);

11년 초과 전 | 3

| 수락됨

답변 있음
Comparing a logical matrix and a numerical matrix?
Assuming 'mask' really is a logical array the same size as 'orig' do: orig = mask.*orig+(~mask).*orig/4; Otherwise if '...

11년 초과 전 | 2

답변 있음
Hot to display a variable from a row ?
Writing j=1:length(m34) makes 'j' a vector with six elements, and therefore m34(j)-mSTAS(i)<=Er is a logical v...

11년 초과 전 | 2

답변 있음
Solving a nonlinear equation with random variable
Write a subfunction using matlab's function 'integral' whose input is a vector 'phi' and computes your expected value for each v...

11년 초과 전 | 3

| 수락됨

답변 있음
how to add two matrix
Let 'a' and 'b' be two row vectors. To add zeros to the left side of the shorter one so as to have equal lengths do this: n...

11년 초과 전 | 2

| 수락됨

답변 있음
how to xor binary vector in matrix
If I understand what you want and if the rows have a multiple of three elements, this should work for you: X = xor(xor(M(:,1...

11년 초과 전 | 3

| 수락됨

답변 있음
solving a non-linear problem
The most recent version of your eight equations (9/11/14) in which eq. 6. had been changed was this: 1. x1/x5 = n; 2. x6*x...

11년 초과 전 | 2

| 수락됨

답변 있음
Solving simultaneous equations numerically
It doesn't matter that your two equations involve an extended summation. You can still create a function that generates these s...

11년 초과 전 | 4

답변 있음
I want to solve This transcendental Equation which contains many roots.Please help me.
I can think of two ways to proceed in finding complex roots to your equation. One way is to use 'fsolve' in the Optimization To...

11년 초과 전 | 0

답변 있음
cumsum that restarts whenever it reaches certain level
I think your code only works on one column at a time. It also appears to have the disadvantage that each time your cumulative s...

11년 초과 전 | 3

| 수락됨

답변 있음
Summation and array indexes
sum(A(:))./sum(sum(B,1),2)

11년 초과 전 | 1

답변 있음
I want to solve This transcendental Equation which contains many roots.Please help me.
No, I think you are mistaken, Aman. There are only two roots, one obvious one at x = 0 and the other at x = -0.4046133685...

11년 초과 전 | 1

답변 있음
Double Integral of Bivariate joint normal distribution
Using 'mvnrnd' to do double integration is an extremely poor method of integration. Just use 'integral2' on the integrand 'mvnp...

11년 초과 전 | 1

| 수락됨

더 보기