Answered
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 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 1

| accepted

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

11 years ago | 0

Answered
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 years ago | 2

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 0

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 1

Answered
How to make my logical data homogene?
data(diff([1,data,1],2)==2) = 1;

11 years ago | 0

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 1

| accepted

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

11 years ago | 4

Answered
Solving Symbolic matrix with different variables
Use matlab's 'solve' function.

11 years ago | 1

Answered
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 years ago | 0

Answered
, 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 years ago | 2

| accepted

Answered
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 years ago | 1

| accepted

Answered
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 years ago | 3

Answered
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 years ago | 2

| accepted

Answered
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 years ago | 0

Answered
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 years ago | 0

Answered
matrix operaions sums multiplications
C = A(:,1:2)*B.';

11 years ago | 3

Answered
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 years ago | 0

Answered
Multidimensional Array Conversion way
A = reshape(permute(A,[1,3,2]),[],1e5);

11 years ago | 1

| accepted

Load more