Beantwortet
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...

mehr als 11 Jahre vor | 0

Beantwortet
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); ...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 2

Beantwortet
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...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 1

Beantwortet
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)

mehr als 11 Jahre vor | 2

Beantwortet
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...

mehr als 11 Jahre vor | 2

Beantwortet
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 ...

mehr als 11 Jahre vor | 2

Beantwortet
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...

mehr als 11 Jahre vor | 1

Beantwortet
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)...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 2

Beantwortet
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);

mehr als 11 Jahre vor | 4

| akzeptiert

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

mehr als 11 Jahre vor | 2

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

mehr als 11 Jahre vor | 3

| akzeptiert

Beantwortet
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 '...

mehr als 11 Jahre vor | 2

Beantwortet
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...

mehr als 11 Jahre vor | 2

Beantwortet
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...

mehr als 11 Jahre vor | 3

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 3

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 2

| akzeptiert

Beantwortet
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...

mehr als 11 Jahre vor | 4

Beantwortet
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...

mehr als 11 Jahre vor | 0

Beantwortet
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...

mehr als 11 Jahre vor | 3

| akzeptiert

Beantwortet
Summation and array indexes
sum(A(:))./sum(sum(B,1),2)

mehr als 11 Jahre vor | 1

Beantwortet
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...

mehr als 11 Jahre vor | 1

Beantwortet
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...

mehr als 11 Jahre vor | 1

| akzeptiert

Mehr laden