답변 있음
How the find the Intersection Points?
You should be aware that your equations are the mathematical equivalent of the geometrical problem of finding the intersections ...

11년 초과 전 | 0

답변 있음
Speeding up Binary Matricies Generation with given conditions
There is a flaw in the strategy of your code. If at the step m = randi([0 1],rows,columns); it does not yield exactly ...

11년 초과 전 | 1

| 수락됨

답변 있음
Looping with unequal increment
x = [5,15,25,30,45,60,65,70,75,90]; for i = 1:length(x) % Get parameter values from x(i) and store them at i-th arr...

11년 초과 전 | 1

| 수락됨

답변 있음
Generating random complex numbers between -0.5 to 0.5 in Gatbx
(rand(20,2)-.5) + (rand(20,2)-.5)*1i ;

11년 초과 전 | 0

답변 있음
I got an errow while plotting 3D surface
If I understand you correctly, the matlab 'surf' function is not the right one for your problem, since it would require that you...

11년 초과 전 | 2

| 수락됨

답변 있음
How to find common numbers in 4 matrices
Apparently from your statement, "find common numbers in 4 matrices", you should be using matlab's 'intersect' function, not 'ism...

11년 초과 전 | 0

답변 있음
Why are these sums not the same?
There is no reason they should be the same! In the for-loop method you are not doing a summation, as is done in the first metho...

11년 초과 전 | 0

| 수락됨

답변 있음
Hi I want to plot t with respect to Vcf in my code , but only obtaining the max plot value only
You need to do a "hold on" to combine all the plotted points. Otherwise after each step of the while loop the previous plot get...

11년 초과 전 | 0

답변 있음
Checking for Pythagoric Triplets
Since there are infinitely many real-valued "Pythagoric" triplets between two given limits, 'k' and 'n', I will guess that you a...

11년 초과 전 | 0

답변 있음
Generating empty interval of points
Do this: LB=20;UB=80; x = LB+(UB-LB)*rand(50,1); y = LB+(UB-LB)*rand(50,1); t = ((x<=40)|(x>=60)) & ((y<=40)|(...

11년 초과 전 | 0

답변 있음
Azimut angles comparison for wind (position differences in a vector)
Presumably you want a difference that lies between 0 and 180, as would be true for the inner angle of any triangle. a = mo...

11년 초과 전 | 0

답변 있음
How can I write such a large matrix?
b = zeros(2^20,20); for k = 1:20 b(:,k) = repmat([zeros(2^(k-1),1);ones(2^(k-1),1)],2^(20-k),1); end

11년 초과 전 | 1

| 수락됨

답변 있음
How to get minimum element of matrix and corresponding row elements
N = sqrt(sum(A.^2,2)); % I assume you mean the L2 norm [Nmin,ix] = min(N); Amin = A(ix,:); where Nmin is the minim...

11년 초과 전 | 0

| 수락됨

답변 있음
creating a random vector of the values 0,1 with specific gaps
There are two possible meanings you might have for the phrase _"20% of the values are 1"_ : 1) The percentage of ones has a ...

11년 초과 전 | 0

답변 있음
getting a vector with random numbers but with new criteria
You want n random integers, each ranging from k to z, such that each differs from the two previous integers. Call the vector of...

11년 초과 전 | 1

답변 있음
How to make my logical data homogene?
data(diff([1,data,1],2)==2) = 1;

11년 초과 전 | 0

답변 있음
How to find the second interesection between two plots?
There is no reason to believe that the best-fitting straight lines to the two entire curves will intersect at the same points as...

11년 초과 전 | 1

| 수락됨

답변 있음
Transforming matrices in a sophisticated way
If a1, a2, a3, ..., an are each p-by-q in size allC = reshape(permute(reshape(allR,p,q,n),[1,3,2]),p*n,q); allR = resh...

11년 초과 전 | 1

| 수락됨

답변 있음
Defining anonymous function using an "if" statement
Try this: f = @(x) (x.^2>=x).*x.^2+(x.^2<x).*x

11년 초과 전 | 4

답변 있음
Solving Symbolic matrix with different variables
Use matlab's 'solve' function.

11년 초과 전 | 1

답변 있음
how do i isolate the elements above both main triangles of a square matrix?
Try this: % Create some arbitrary square matrix, M n = 12; M = magic(n); % Erase all but your "upper triangl...

11년 초과 전 | 0

답변 있음
, I need help! I do not get to have the graph of the solution of a differential equation.
I am guessing that you left out the parentheses in the denominator of F, which would presumably be this instead: F=@(x,s)(...

11년 초과 전 | 2

| 수락됨

답변 있음
function in the matlab
If Q is a vector, I would suggest the following: W = zeros(size(Q)); W(1) = Q(1); for k = 2:length(Q) W(k) =...

11년 초과 전 | 1

| 수락됨

답변 있음
How to extend a array by multiplying internal values e.g. [1 2 3 4] to [1 1 1 2 2 2 3 3 3 4 4 4]?
B = A(ceil((1:4*size(A,2))/4)); % <--- Corrected

11년 초과 전 | 3

답변 있음
find area of triangle with 3 points known
If I interpret the figure correctly, the area is: a = 1/2*(xmax-xmin)*ymax; In general a triangle's area is one-half it...

11년 초과 전 | 2

| 수락됨

답변 있음
what's the error in this code ? it should return the position of the minimum electric field but it return zeros ,whyyyyy T~T
Instead of computing the total electric field for all charges at each separate point, you appear to be summing the field compone...

11년 초과 전 | 0

답변 있음
How to use end result for the next iteration
In my opinion, there is a lot of wasted computation in your code, Zahid. For example, the inequality p(j)<d(j) is equivalent to...

11년 초과 전 | 0

답변 있음
matrix operaions sums multiplications
C = A(:,1:2)*B.';

11년 초과 전 | 3

답변 있음
Problem of Substraction operation on MATLAB R2014a
Just because the two quantities both displayed 912.7400 does not mean that the quantities they represent in the computer are act...

11년 초과 전 | 0

답변 있음
Multidimensional Array Conversion way
A = reshape(permute(A,[1,3,2]),[],1e5);

11년 초과 전 | 1

| 수락됨

더 보기