답변 있음
Solving 2 parameters equation
I see no unknown variable ‘D’ here. Also the variable ‘Lc’ is not defined. Do you mean that Lc and nR are actually the two unk...

거의 10년 전 | 0

답변 있음
Finding maximum value of y at some x
[~,p] = sort(y,’descend’); x2 = x(p(1:2)); % <-- x values at first and second maxima of y

거의 10년 전 | 1

답변 있음
Why .^2 does not work as expected?
I think you need to convert I to ‘double’ before doing the exponentiation on it. As it is, I believe it is ‘uint8’ type and any...

거의 10년 전 | 1

| 수락됨

답변 있음
Can I vectorize this any further?
My understanding is that - I admit I haven’t tried this - if you use the ‘bsxfun’ with its ‘fun’ defined as ‘besselj’ and the tw...

거의 10년 전 | 0

| 수락됨

답변 있음
way to avoid for loops
This is for your revised problem involving the 'exp' function. (Note: I am assuming the x and y in your code are just as you ha...

거의 10년 전 | 0

답변 있음
Generalizing algorithm to find all combinations of sums of vectors.
Let’s suppose that the g’s are the rows in an m by n matrix, G. That is, each n-element row is one of the g’s and there are m o...

거의 10년 전 | 0

| 수락됨

답변 있음
How to set zeros to NaN in specific columns
T = reshape(A(:,2:6),[],1); T(T==0) = nan; A = [A(:,1),reshape(T,[],5)];

거의 10년 전 | 1

| 수락됨

답변 있음
Why does my answer converges? "iterations"
You are apparently trying to solve a quadratic equation in z_v and a cubic equation in z_l. Instead of using the highly questio...

거의 10년 전 | 0

답변 있음
way to avoid for loops
If x and y are arbitrarily defined as N-by-N arrays, do this: [I,J] = ndgrid(1:N); s = sum(x(:))*I+sum(y(:))*J; Wit...

거의 10년 전 | 2

답변 있음
nonlinear differential equation system
Your three equations can be reduced to one equation. By using the second two equations it can be deduced that x2 = 2 - x1...

거의 10년 전 | 1

| 수락됨

답변 있음
Inner matrix dimensions must agree.
As it stands, your ‘Z’ variable is empty. You write: “Z=10*10^-2:60*10^-6;”, and the colon operator by default counts up by one...

거의 10년 전 | 0

| 수락됨

답변 있음
Nonlinear 3 equations 3 unknowns , hyperbolic, fsolve stopped because the last step was ineffective
It is relatively easy to convert your three equations in three unknowns into a single equation in a single unknown. That would ...

거의 10년 전 | 1

| 수락됨

답변 있음
[x,y,z] = sphere, except uniform or random distributed points
Here is a way to generate random points on a sphere that is statistically uniform. r = randn(3,n); % Use a large n r =...

거의 10년 전 | 4

| 수락됨

답변 있음
Is there any one who can help me how to sum the following summation expression? I tried but it said to many inputs. Thank you for your help!
The first result with ‘symsum’ very likely indicates that ‘symsum’ is unable to compute this particular infinite sum. The sec...

거의 10년 전 | 0

| 수락됨

답변 있음
how can i determine why my code is accepting a non integer when it's not suppose to
Your instructions specified that if the input is invalid, you were to return an empty string. This you did not do. Instead your ...

거의 10년 전 | 1

답변 있음
How can i make a code to find y of y''=y*y' ?
To solve your equation numerically using one of the ode functions, you set it up as two simultaneous differential equations: ...

거의 10년 전 | 0

| 수락됨

답변 있음
need help solving this summation
Make these changes in your code: L=3; W=5; x=linspace(0,L,10); y = linspace(0,W,7); N=9; P = 1:2:N ...

거의 10년 전 | 1

| 수락됨

답변 있음
Perimeter of a part of an ellipse
If (x0,y0) is the center of the ellipse, if a and b are the two semi-axis lengths, and if p is the counterclockwise angle of the...

거의 10년 전 | 2

답변 있음
Using logical operator in an if condition
You are using the "short circuit" logical operators. They work for scalars but not for vectors with more than one element. In ...

거의 10년 전 | 0

답변 있음
sub2ind gives an error: Error using sub2ind (line 43) Out of range subscript. How to solve this?
Part of your circle has indices of zero value which means the circle extends beyond the limits of K. Move it a little further t...

거의 10년 전 | 1

| 수락됨

답변 있음
FLOPS in Complex Array Multiplication
I count six floating point operations per complex multiplication. If your matrix is N-by-N, that would be a total of 6*N^2 flop...

거의 10년 전 | 1

| 수락됨

답변 있음
What is the problem with this for loop?
For each of the for-loops ‘clock’ can take only one value. For example, with "for clock = 1.000:1.999", clock can only be 1.000...

거의 10년 전 | 0

답변 있음
why this command: a([],[],:)=A doesn't work? I try not to use for command
As you have defined ax and ay, they are: ax = 1:512; and ay = ones(1,512); Just look at them to see that. This ...

거의 10년 전 | 0

답변 있음
How can I convert a 3D matrix to 2D matrix in the way specified in this post
result = reshape(permute(val,[1,3,2]),[],size(val,2)); % <-- Corrected

거의 10년 전 | 2

| 수락됨

답변 있음
Random numbers drawn from power law with certain mean
You are correct that the distribution can by generated by b*rand(n,1).^(-D) where b and D are positive parameters. Th...

거의 10년 전 | 1

| 수락됨

답변 있음
How I can extract data from a vector based on index
B = A(setdiff((1:length(A)).’,index(:))); or if you're sure A and index are row vectors just B = A(setdiff(1:length(...

거의 10년 전 | 1

| 수락됨

답변 있음
Engineering Statics Problem in 3 dimensions
Yes, if you wish, you can solve your problem using matlab as follows: c1 = cross([0;0;2],[.2673;.8018;.5345]); c2 = cr...

거의 10년 전 | 0

답변 있음
How to use the Golden-Section Search for finding the MAX f(x) value?
Finding the maximum would work the same way as with the minimum except that 1) you need to work in an interval for which your fu...

거의 10년 전 | 0

답변 있음
Integral of controllability gramian
In matlab there is a very important difference between e.^((A.’)*τ) and e^((A.’)*τ) (without the dot.) The first of these is an ...

거의 10년 전 | 0

답변 있음
I need to extract a row that coincides with a number in the first column.
I agree with Cyclist’s comment as to the lack of clarity in your request, but I will take a very wild guess as to what you are a...

거의 10년 전 | 0

더 보기