답변 있음
How to solve a coupled system of differential equations with two derivatives in one equation?
I think the easiest way would be to solve for dx/dt and then use any of the numerical ode functions: dx/dt = x/y+x-x^2 d...

11년 초과 전 | 2

답변 있음
Question about using fzero to find all real roots of a polynomial
*Is it possible to display all of the real roots of this polynomial using the fzero command?* The answer to this question is ...

11년 초과 전 | 0

답변 있음
got stunned and cannot display on commond during using while-loop
1. You used "(1-x./n).^n" instead of the required "(1+x/n)^n", so you can never hope to match elements of 'myVal' with those of ...

11년 초과 전 | 2

답변 있음
how to calculate pdf probabilitity of i.i.d
This is apparently homework. Here's a hint to get you started. If x is the maximum of x1,x2,...,xn, the probability that x <= ...

11년 초과 전 | 2

답변 있음
Three ways to do the same integration leading to three different speeds: why?
As to the difference between method 1 and 2, for each of the million trips through the loop method 2 has to construct and then a...

11년 초과 전 | 0

답변 있음
how do i use for loop to fine determinant of Vandermonde matrix?
Let V be an n-by-n Vandermonde matrix. d = 1; for k = 1:n-1 d = d*prod(V(k+1:n,2)-V(k,2)); end % <-- At exit...

11년 초과 전 | 2

| 수락됨

답변 있음
Error using round(reshape(message,Mm*Nm,1)./256)
Does 'lena.jpg' produce a third dimension for color? If so, that would account for your error message; you would have more than...

11년 초과 전 | 1

답변 있음
Double & Triple Integration with tabular data
You can use Matlab's 'trapz' successively for this purpose. The easiest case is integrating over a rectangular region in (x,y) ...

11년 초과 전 | 2

| 수락됨

답변 있음
How to give IF condition in following code?
b = true; while b yt = randi([0,1],W,1); b = (sum(yt)<2); % Repeat if 'yt' has less than two ones end ...

11년 초과 전 | 2

| 수락됨

답변 있음
how do i find the angle between a vector and a line?
b = [2,5,8]; % vector along line ang = atan2(norm(cross(a,b)),dot(a,b)); % Angle in radians between vectors a and b (N...

11년 초과 전 | 1

답변 있음
two coupled algebraic equations
Multiply each equation by x/k^2. The first equation becomes a quadratic equation in the ratio x/k and the second one becomes a ...

11년 초과 전 | 0

답변 있음
Extract random sample x,y,z data inside the circle
In setting 'view' to view(5,90) which is a view from overhead and referring to cartesian coordinates, a0 and b0, at the center o...

11년 초과 전 | 1

| 수락됨

답변 있음
error : minus matrix dimention
Hamid, your 'solveq' function is clearly intended only for an 'f' input argument consisting of a column vector, not the 3-by-n s...

11년 초과 전 | 1

답변 있음
How to convert this code without 'goto' statement?
That is code you wouldn't want to use. As it stands the function has no way to exit. Regardless of the results of all the 'if'...

11년 초과 전 | 0

답변 있음
Plotting a function in a range of variable
If you want to do plotting with 'alpha' in the range alpha=0:0.1:2, you should not declare 'alpha' as a symbolic variable. Inst...

11년 초과 전 | 2

| 수락됨

답변 있음
Can anyone help me with for loops in Matlab?
Here is code for doing selection sorting, Anthony. However, as it stands it works only on a single column vector and does not i...

11년 초과 전 | 1

| 수락됨

답변 있음
if" function in matrix elements
s = sum(G(:)<=1); if s == 1 C = A+B elseif s == 2 C = A-B else ??? What do you want to happen...

11년 초과 전 | 2

| 수락됨

답변 있음
How to make Duplicate values
p = cumsum(accumarray(cumsum([1,Q])',1))'; R = W(p(1:end-1)); Note: If you have a zero in Q, the corresponding W value...

11년 초과 전 | 3

| 수락됨

답변 있음
i was asked to develop a program that will evaluate a function for -0.9<x<0.9 in steps of 0.1 by arithmetic statement, and series allowing as many as 50 terms. however, end adding terms when the last term only affects the 6th significant in answer
You can use a for-loop with a 'break' to generate successive terms and their sum. For each value of x you are required to use, ...

11년 초과 전 | 0

답변 있음
Plot y^2 = x^2 + 1 (The expression to the left of the equals sign is not a valid target for an assignment.)
You can generate this hyperbola plot using hyperbolic functions as parameters: t = linspace(-4,4,500); x = sinh(t); ...

11년 초과 전 | 1

답변 있음
Generating a random variable that has a predefined covariance with other random variable
You haven't stated what you want the variance of X to be. If it is to be 1, the trivial solution would be to set X = e. For ge...

11년 초과 전 | 3

| 수락됨

답변 있음
User-Defined Selection Sort for 2-D arrays of any size (MATLAB)
function [array2,p] = sortorder(array,col) [~,p] = sort(array(:,col)); array2 = array(p,:); return

11년 초과 전 | 3

| 수락됨

답변 있음
Replace NaNs with next real value.
Here's another way: t = isnan(x); f1 = find(t); f2 = find(diff([t,false])==-1)+1; f3 = zeros(1,length(f1)); ...

11년 초과 전 | 0

답변 있음
How to solve an equation with piecewise defined function?
Instead of using 'solve' you can use 'fzero' for this problem. Of course this problem is so simple you can do it in your head, ...

11년 초과 전 | 2

답변 있음
hi, i need your help, y''=xy, y(0)=0 and y(0)=1 this second order DE i can solve in power series method i got recurrence relation
I don't agree with your recurrence equation, Jamila. For the series I get: y = x + x^4/(3*4) + x*7/(3*4*6*7) + x10/(3*4*6*...

11년 초과 전 | 1

답변 있음
can i integrate this function using integral?
You haven't shown us your code for using the 'integral' function, but your code for using 'trapz' has the right integrand functi...

11년 초과 전 | 1

답변 있음
Find s, such that det(A+s*D) = d.
If d is real and only real roots are being sought for s, you can simply write a function that accepts a scalar value s and compu...

11년 초과 전 | 0

답변 있음
compute the 2 dimensional (x,y) with respect to time
Let 'a' be the given vector. plot3(a(1:3:end),a(2:3:end),a(3:3:end),'r-')

11년 초과 전 | 1

| 수락됨

답변 있음
I am having trouble finding the values for a certain variable which contains the "cosh(x)"
The function cosh(x) is defined as (exp(x)+exp(-x))/2 and therefore as x increases in size, the value of cosh(x) increases expon...

11년 초과 전 | 2

| 수락됨

답변 있음
Creating a function to plot multiple column of a variable in workspace
Just use a for-loop for this purpose: for k = 1:n plot(wavelengtha(:,k), Raman); hold on end What could...

11년 초과 전 | 1

| 수락됨

더 보기